-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Add delayed deletion of rowsets function, fix -230 error. #4039
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add delayed deletion of rowsets function, fix -230 error. #4039
Conversation
be/src/olap/tablet.cpp
Outdated
| _rs_graph.construct_rowset_graph(_tablet_meta->all_rs_metas()); | ||
| // change _rs_graph to _versioned_rs_tracker | ||
| // _rs_graph.construct_rowset_graph(_tablet_meta->all_rs_metas()); | ||
| _versioned_rs_tracker.construct_versioned_tracker(_tablet_meta->all_rs_metas(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
66 - 67 has nonstandard format
0f8d14d to
5eb43d3
Compare
| RETURN_NOT_OK(gc_unused_rowsets()); | ||
| TRACE("unused rowsets have been moved to GC queue"); | ||
| // RETURN_NOT_OK(gc_unused_rowsets()); | ||
| // TRACE("unused rowsets have been moved to GC queue"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove it
be/src/olap/rowset_graph.cpp
Outdated
| } | ||
|
|
||
| void RowsetGraph::construct_rowset_graph(const std::vector<RowsetMetaSharedPtr>& rs_metas, | ||
| int64_t& max_version) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| int64_t& max_version) { | |
| int64_t* max_version) { |
Better to use point to indicate it is a output parameter.
be/src/olap/rowset_graph.h
Outdated
|
|
||
| /// RowsetGraph class which is implemented to build and maintain total versions of rowsets. | ||
| /// This class use adjacency-matrix represent rowsets version and links. A vertex is a version | ||
| /// and a link is the _version object of a rowset (from start version to end version). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| /// and a link is the _version object of a rowset (from start version to end version). | |
| /// and a link is the _version object of a rowset (from start version to end version + 1). |
be/src/olap/rowset_graph.h
Outdated
| }; | ||
|
|
||
| } // namespace doris | ||
| /// VersionTracker class which is implemented to maintain compacted version path of rowsets. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| /// VersionTracker class which is implemented to maintain compacted version path of rowsets. | |
| /// VersionTracker class which is implemented to maintain multi-version path of rowsets. |
be/src/olap/rowset_graph.h
Outdated
| /// VersionedRowsetTracker class is responsible to track all rowsets version links of a tablet. | ||
| /// This class not only records the graph of all versions, but also records the paths which will be removed | ||
| /// after the path is expired. | ||
| class VersionedRowsetTracker { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| class VersionedRowsetTracker { | |
| class TimestampedVersionTracker { |
be/src/olap/rowset_graph.cpp
Outdated
| // 2 remove this path from other_path | ||
| auto path_iter = path_version_ptr->begin(); | ||
| for (; path_iter != path_version_ptr->end(); path_iter++) { | ||
| Version version = (*path_iter)->version(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Version version = (*path_iter)->version(); | |
| const Version& version = (*path_iter)->version(); |
be/src/olap/rowset_graph.cpp
Outdated
| _construct_versioned_tracker(rs_metas, expired_snapshot_rs_metas); | ||
| } | ||
|
|
||
| void VersionedRowsetTracker::reconstruct_versioned_tracker( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks same as construct_versioned_tracker()
be/src/olap/rowset_graph.cpp
Outdated
|
|
||
| while (iter != _expired_snapshot_rs_path_map.end()) { | ||
| std::vector<VersionTrackerSharedPtr>::iterator version_path_iter = iter->second->begin(); | ||
| int64_t max_create_time = -1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can save the max_create_time of a version path in _expired_snapshot_rs_path_map
be/src/olap/rowset_graph.cpp
Outdated
| } | ||
| } | ||
|
|
||
| void VersionedRowsetTracker::_print_current_state() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better to return a string, and let the caller decide how to print it.
3ed0620 to
64713d0
Compare
morningman
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
morningman
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Related issue #4017, main changes as follows: