yiguolei commented on a change in pull request #1976: And multi-path in
RowsetGraph
URL: https://github.com/apache/incubator-doris/pull/1976#discussion_r334337832
##########
File path: be/src/olap/tablet.cpp
##########
@@ -1134,4 +950,42 @@ OLAPStatus
Tablet::generate_tablet_meta_copy(TabletMetaSharedPtr new_tablet_meta
return OLAP_SUCCESS;
}
+OLAPStatus Tablet::capture_unused_rowsets() {
+ Version max_version_before_hole;
+ VersionHash v_hash;
+
+ WriteLock wrlock(&_meta_lock);
+
RETURN_NOT_OK(max_continuous_version_from_begining_unlock(&max_version_before_hole,
&v_hash));
+
+ std::vector<Version> shortest_version_path;
+ RETURN_NOT_OK(_rs_graph.capture_consistent_versions(Version(0,
max_version_before_hole.second), &shortest_version_path));
+
+ std::vector<std::pair<Version, RowsetSharedPtr>> rowsets_to_remove;
+ for (auto& it : _rs_version_map) {
+ if (it.second->start_version() > max_version_before_hole.second) {
+ // There are only one path after hole in versions.
+ continue;
+ }
+ bool in_path = false;
+ for (auto& version : shortest_version_path) {
+ if (it.second->start_version() == version.first
+ && it.second->end_version() == version.second) {
Review comment:
use start_version() == version
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]