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

[BugFix] fix potential thread safe issue about pindex major compact (backport #44238) #44264

Merged
merged 2 commits into from
Apr 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion be/src/storage/persistent_index.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4522,6 +4522,7 @@ Status PersistentIndex::major_compaction(Tablet* tablet) {
return Status::OK();
}
// 1. load current l2 vec
ASSIGN_OR_RETURN(auto fs, FileSystem::CreateSharedFromString(_path));
std::vector<EditVersion> l2_versions;
std::vector<std::unique_ptr<ImmutableIndex>> l2_vec;
DCHECK(prev_index_meta.l2_versions_size() == prev_index_meta.l2_version_merged_size());
Expand All @@ -4530,7 +4531,7 @@ Status PersistentIndex::major_compaction(Tablet* tablet) {
auto l2_block_path = strings::Substitute("$0/index.l2.$1.$2$3", _path, prev_index_meta.l2_versions(i).major(),
prev_index_meta.l2_versions(i).minor(),
prev_index_meta.l2_version_merged(i) ? MergeSuffix : "");
ASSIGN_OR_RETURN(auto l2_rfile, _fs->new_random_access_file(l2_block_path));
ASSIGN_OR_RETURN(auto l2_rfile, fs->new_random_access_file(l2_block_path));
ASSIGN_OR_RETURN(auto l2_index, ImmutableIndex::load(std::move(l2_rfile)));
l2_vec.emplace_back(std::move(l2_index));
}
Expand Down
Loading