Skip to content
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

Closed
wants to merge 1 commit into from
Closed

Add multi-path in RowsetGraph #1761

wants to merge 1 commit into from

Conversation

chaoyli
Copy link
Contributor

@chaoyli chaoyli commented Sep 8, 2019

  1. Do not remove rowset from RowsetGraph after compaction
  2. Collect unused rowset at interval
  3. Remove inc_version and related code

@chaoyli
Copy link
Contributor Author

chaoyli commented Sep 8, 2019

Related issue is #1759

@morningman morningman changed the title And multi-path in RowsetGraph Add multi-path in RowsetGraph Sep 8, 2019
vector<pair<Version, VersionHash>> existing_versions;
for (auto& rs : _tablet_meta->all_rs_metas()) {
LOG(INFO) << "rs version:" << rs->version().first
Copy link
Contributor

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

@@ -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();
Copy link
Contributor

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

@@ -40,11 +40,17 @@ namespace doris {
volatile uint32_t g_schema_change_active_threads = 0;

OLAPStatus StorageEngine::_start_bg_worker() {
Copy link
Contributor

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

@@ -970,4 +878,42 @@ void Tablet::pick_candicate_rowsets_to_base_compaction(std::vector<RowsetSharedP
}
}

OLAPStatus Tablet::capture_unused_rowsets() {
Copy link
Contributor

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();
Copy link
Contributor

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
Copy link
Contributor

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.

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);
Copy link
Contributor

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.

}

RowsetMetaSharedPtr TabletMeta::acquire_inc_rs_meta_by_version(const Version& version) const {
RowsetMetaSharedPtr rs_meta = nullptr;
Copy link
Contributor

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.

@@ -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);
Copy link
Contributor

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.

@@ -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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clone will always failed

return OLAP_SUCCESS;
}

OLAPStatus Tablet::delete_rowsets(const vector<RowsetSharedPtr>& to_delete) {
vector<RowsetMetaSharedPtr> rs_metas_to_delete;
Copy link
Contributor

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

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());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
existing_versions.emplace_back(rs->version() , rs->version_hash());
existing_versions.emplace_back(rs->version(), rs->version_hash());

@morningman
Copy link
Contributor

in src//olap/tablet.cpp, the function capture_consistent_versions() which will print WANRNING log when version missing. But these is in critical read path of Doris, so I think WARNING log can not be printed here.

Copy link
Contributor

@yiguolei yiguolei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some comments

@morningman morningman added this to TODO in Decoupling storage from computation via automation Sep 11, 2019
@chaoyli chaoyli closed this Sep 16, 2019
SWJTU-ZhangLei pushed a commit to SWJTU-ZhangLei/incubator-doris that referenced this pull request Jul 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

4 participants