-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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 concurrent issue between primary index unload and compaction #49341
Conversation
…tion Signed-off-by: luohaha <[email protected]>
f0efeee
to
4978ddd
Compare
Signed-off-by: luohaha <[email protected]>
[FE Incremental Coverage Report]✅ pass : 0 / 0 (0%) |
[BE Incremental Coverage Report]✅ pass : 20 / 20 (100.00%) file detail
|
|
||
if (tablet->get_enable_persistent_index() && (fix_size <= 128)) { |
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.
is this a new function change to open the pk index limitation, not related to the bug fix?
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 a historical problem, no need for now.
@@ -103,13 +102,13 @@ Status LakePrimaryIndex::_do_lake_load(TabletManager* tablet_mgr, const TabletMe | |||
RETURN_IF_ERROR(StorageEngine::instance() | |||
->get_persistent_index_store(metadata->id()) | |||
->create_dir_if_path_not_exists(path)); | |||
_persistent_index = std::make_unique<LakeLocalPersistentIndex>(path); | |||
_persistent_index = std::make_shared<LakeLocalPersistentIndex>(path); |
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.
is there a necessity to perform the load under lock? since there is already a lock defined and used for pk index.
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 will be call when first time initial, no concurrency issue at this phase.
@Mergifyio backport branch-3.3 |
@Mergifyio backport branch-3.2 |
@Mergifyio backport branch-3.1 |
✅ Backports have been created
|
✅ Backports have been created
|
✅ Backports have been created
|
…tion (#49341) Signed-off-by: luohaha <[email protected]> (cherry picked from commit 1c8df3a)
…tion (#49341) Signed-off-by: luohaha <[email protected]> (cherry picked from commit 1c8df3a) # Conflicts: # be/src/storage/lake/lake_primary_index.cpp # be/src/storage/primary_index.cpp # be/test/storage/lake/local_pk_index_manager_test.cpp
…tion (#49341) Signed-off-by: luohaha <[email protected]> (cherry picked from commit 1c8df3a) # Conflicts: # be/src/storage/lake/lake_primary_index.cpp # be/src/storage/persistent_index.h
…tion (backport #49341) (#49427) Signed-off-by: Yixin Luo <[email protected]> Co-authored-by: Yixin Luo <[email protected]>
…tion (backport #49341) (#49428) Signed-off-by: Yixin Luo <[email protected]> Co-authored-by: Yixin Luo <[email protected]>
…tion (backport #49341) (#49426) Co-authored-by: Yixin Luo <[email protected]>
Why I'm doing:
When Primary Index call
unload
because of full clone or something else, there could be a background index compaction task was still running. Here is a concurrency safe issue.What I'm doing:
std::shared_ptr
instead ofstd::unique_ptr
, so running index compaction task could finish safely.What type of PR is this:
Does this PR entail a change in behavior?
If yes, please specify the type of change:
Checklist:
Bugfix cherry-pick branch check: