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 multi-path in RowsetGraph #1761
Conversation
chaoyli
commented
Sep 8, 2019
- Do not remove rowset from RowsetGraph after compaction
- Collect unused rowset at interval
- Remove inc_version and related code
Related issue is #1759 |
be/src/olap/tablet.cpp
Outdated
vector<pair<Version, VersionHash>> existing_versions; | ||
for (auto& rs : _tablet_meta->all_rs_metas()) { | ||
LOG(INFO) << "rs version:" << rs->version().first |
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.
Should use DEBUG level bug
be/src/olap/tablet.h
Outdated
@@ -233,6 +228,7 @@ class Tablet : public std::enable_shared_from_this<Tablet> { | |||
// eco mode also means save money in palo | |||
inline bool in_eco_mode() { return false; } | |||
|
|||
OLAPStatus capture_unused_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.
Add comment to explain this function
be/src/olap/olap_server.cpp
Outdated
@@ -40,11 +40,17 @@ namespace doris { | |||
volatile uint32_t g_schema_change_active_threads = 0; | |||
|
|||
OLAPStatus StorageEngine::_start_bg_worker() { |
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.
Add comment to explain what are these bg thread doing
be/src/olap/tablet.cpp
Outdated
@@ -970,4 +878,42 @@ void Tablet::pick_candicate_rowsets_to_base_compaction(std::vector<RowsetSharedP | |||
} | |||
} | |||
|
|||
OLAPStatus Tablet::capture_unused_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.
You will iterate all tablet every time with lock, and I think it can be improved.
@@ -68,11 +68,6 @@ OLAPStatus OlapSnapshotConverter::to_olap_header(const TabletMetaPB& tablet_meta | |||
PDelta* pdelta = olap_header->add_delta(); | |||
convert_to_pdelta(rs_meta, pdelta); | |||
} | |||
// not add pending delta, it is usedless in clone or backup restore | |||
for (auto& inc_rs_meta : tablet_meta_pb.inc_rs_metas()) { | |||
PDelta* pdelta = olap_header->add_incremental_delta(); |
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.
This code is useful in clone from new BE to old BE.
@@ -129,20 +124,6 @@ OLAPStatus OlapSnapshotConverter::to_tablet_meta_pb(const OLAPHeaderMessage& ola | |||
_rs_version_map[rowset_version] = rowset_meta; | |||
} | |||
|
|||
for (auto& inc_delta : olap_header.incremental_delta()) { | |||
// check if inc delta already exist in delta |
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.
It is useful when upgrade from old BE to new BE.
be/src/olap/snapshot_manager.cpp
Outdated
vector<RowsetMetaSharedPtr> empty_rowsets; | ||
new_tablet_meta->revise_rs_metas(empty_rowsets); | ||
} else { | ||
// If this is a full clone, then should clear inc rowset metas because | ||
// related files is not created | ||
vector<RowsetMetaSharedPtr> empty_rowsets; | ||
new_tablet_meta->revise_inc_rs_metas(empty_rowsets); | ||
new_tablet_meta->revise_rs_metas(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.
revise is not useful any more. should remove it.
be/src/olap/tablet_meta.cpp
Outdated
} | ||
|
||
RowsetMetaSharedPtr TabletMeta::acquire_inc_rs_meta_by_version(const Version& version) const { | ||
RowsetMetaSharedPtr rs_meta = nullptr; |
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.
It is used in incremental clone, if it is removed the clone logic may run to error.
be/src/olap/schema_change.cpp
Outdated
@@ -1250,7 +1250,7 @@ OLAPStatus SchemaChangeHandler::_do_process_alter_tablet_v2(const TAlterTabletRe | |||
rowsets_to_delete.push_back(rowset); | |||
} | |||
} | |||
new_tablet->modify_rowsets(std::vector<RowsetSharedPtr>(), rowsets_to_delete); | |||
new_tablet->delete_rowsets(rowsets_to_delete); |
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 there should be only one method calling delete rowsets. it is capture unused rowset.
be/src/olap/snapshot_manager.cpp
Outdated
@@ -438,14 +422,12 @@ OLAPStatus SnapshotManager::_create_snapshot_files( | |||
new_tablet_meta->delete_alter_task(); | |||
|
|||
if (request.__isset.missing_version) { | |||
new_tablet_meta->revise_inc_rs_metas(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.
Clone will always failed
be/src/olap/tablet.cpp
Outdated
return OLAP_SUCCESS; | ||
} | ||
|
||
OLAPStatus Tablet::delete_rowsets(const vector<RowsetSharedPtr>& to_delete) { | ||
vector<RowsetMetaSharedPtr> rs_metas_to_delete; |
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.
delete rowsets should add the rowset to unused rowset list
be/src/olap/tablet.cpp
Outdated
vector<pair<Version, VersionHash>> existing_versions; | ||
for (auto& rs : _tablet_meta->all_rs_metas()) { | ||
LOG(INFO) << "rs version:" << rs->version().first | ||
<< "-" << rs->version().second; | ||
existing_versions.emplace_back(rs->version() , rs->version_hash()); |
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.
existing_versions.emplace_back(rs->version() , rs->version_hash()); | |
existing_versions.emplace_back(rs->version(), rs->version_hash()); |
in |
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.
some comments
…ns for dynamic table (apache#1761)