-
Notifications
You must be signed in to change notification settings - Fork 590
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
fix(storage): fix correct_commit_ssts with sst table_ids #18414
Conversation
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.
LGTM
@@ -426,15 +426,17 @@ impl HummockManager { | |||
for (mut sst, group_table_ids) in sst_to_cg_vec { | |||
for (group_id, match_ids) in group_table_ids { | |||
let group_members_table_ids = group_members_table_ids.get(&group_id).unwrap(); | |||
if match_ids | |||
if sst |
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 seems unnecessary and unclear to put this under the nested for loop. What we want to do here is to avoid SST split if all existing table ids of a sst belong to one and only one compaction group. Therefore, I suggest we put this check before L427 in the outer for loop. IIUC, we only need to check whether group_table_ids.len() == 1
.
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.
Btw, do you think we need to modify table_ids
and sst_size
if group_table_ids.len() == 1
but table_ids in SstableInfo is a super set of group_member_table_ids
(i.e. L407 is hit)
…nto li0k/storage_fix_correct_commit_ssts
…nto li0k/storage_fix_correct_commit_ssts
let set1: HashSet<_> = sst_info.table_ids.iter().cloned().collect(); | ||
let set2: HashSet<_> = new_sst_table_ids.iter().cloned().collect(); | ||
// sst.table_ids = vec[1, 2, 3]; | ||
// new.table_ids = vec[2, 3, 4]; |
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.
nits: new_table_ids
…nto li0k/storage_fix_correct_commit_ssts
I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.
What's changed and what's your intention?
The main branch will directly commits the sst directly to both cgs (when match_ids is a subset of group_table_ids) , the sst_id is not changed and something goes wrong when merge is triggered.
risingwave/src/storage/src/hummock/utils.rs
Line 112 in cb29fe0
Hummock
filter_single_sst
via binary_search which rely on the ordering of sstable_info.table_ids. I made some mistakes before this PR that broke ordering, so I'm reviewing the code and adding restrictions and doc to ensure ordering of table_ids. Thanks @hzxa21 for helpChecklist
./risedev check
(or alias,./risedev c
)Documentation
Release note
If this PR includes changes that directly affect users or other significant modifications relevant to the community, kindly draft a release note to provide a concise summary of these changes. Please prioritize highlighting the impact these changes will have on users.