-
Notifications
You must be signed in to change notification settings - Fork 594
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(meta): trivial move bug #15659
fix(meta): trivial move bug #15659
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -243,6 +243,10 @@ impl IntraCompactionPicker { | |
continue; | ||
} | ||
|
||
if level_handlers[0].is_level_pending_compact(level) { | ||
continue; | ||
} | ||
|
||
if l0.sub_levels[idx + 1].vnode_partition_count | ||
!= l0.sub_levels[idx].vnode_partition_count | ||
{ | ||
|
@@ -272,18 +276,6 @@ impl IntraCompactionPicker { | |
assert!(overlap | ||
.check_multiple_overlap(&l0.sub_levels[idx].table_infos) | ||
.is_empty()); | ||
let mut target_level_idx = idx; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Until we're sure this has no impact, keep the comments There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No. It may cause some bug... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please be more specific :)
What is the bug? Is it the same bug in this issue? I think the intention of the change here is to disallow trivial move for more than one level.
Why is the operation here relevant to #15523. I though #15523 is just a batching optimization to amortize the cost of ETCD I/O and memory copy. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because if we can batch several task in once transaction, we do not need to move sstable file across several sub levels. |
||
while target_level_idx > 0 { | ||
if l0.sub_levels[target_level_idx - 1].level_type | ||
!= LevelType::Nonoverlapping as i32 | ||
|| !overlap | ||
.check_multiple_overlap(&l0.sub_levels[target_level_idx - 1].table_infos) | ||
.is_empty() | ||
{ | ||
break; | ||
} | ||
target_level_idx -= 1; | ||
} | ||
|
||
let select_input_size = select_sst.file_size; | ||
let input_levels = vec![ | ||
|
@@ -301,7 +293,7 @@ impl IntraCompactionPicker { | |
return Some(CompactionInput { | ||
input_levels, | ||
target_level: 0, | ||
target_sub_level_id: l0.sub_levels[target_level_idx].sub_level_id, | ||
target_sub_level_id: level.sub_level_id, | ||
select_input_size, | ||
total_file_count: 1, | ||
..Default::default() | ||
|
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 check sufficient? Is it possible that there is a race between a trivial move task and a regular task both outputting to a target sub-level with no SSTs?
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 do not understand, why there would be race?
If some regular task try to compact target level x from y, the trivial move task to sub level either x or y would be prevent.
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 it possible to has a regular task trying to compact level x, x+1, x+2, x+3 to y and the trivial move task trying to compact task from x+1 to x+2 while x+2 is empty?