-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
Try to deflake unit test RoundRobinSubcompactionsAgainstPressureToken
#13254
base: main
Are you sure you want to change the base?
Conversation
e3d646f
to
0963206
Compare
@@ -6446,21 +6446,34 @@ TEST_P(RoundRobinSubcompactionsAgainstPressureToken, PressureTokenTest) { | |||
ASSERT_EQ(kFilesPerLevel, NumTableFilesAtLevel(lvl, 0)); | |||
} | |||
|
|||
bool compaction_num_verified = false; |
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.
nit: compaction_num_input_files_verified
// Pick a small target level size to pick more files to compact | ||
// and trigger subcompaction. | ||
// Cannot be too small to cause compaction pressure. | ||
options.max_bytes_for_level_base = 40 * kKeysPerBuffer * 1024; |
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.
Can you translate 40 to something related to kFilesPerLevel and kNumSubcompactions just so to avoid hard-coded value?? Maybe kFilesPerLevel - 4* kNumSubcompactions? Also add comment about (1) the actual num subcompaction won't be 4 since it will be constrained by bg compaction number env_->SetBackgroundThreads(kNumSubcompactions, Env::LOW);
(2) how compaction pressure relates to max_bytes_for_level_base
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 with some comments
Summary: unit test
RoundRobinSubcompactionsAgainstPressureToken.PressureTokenTest
has been flaky. num_planned_subcompactions can be 1 for two reasons: compactions not having enough input files or that there were not enough bg threads. This PR updates the test to try to trigger a larger compaction for subcompactions, and added a callback to verify compactions have enough input files.Test plan: monitor future failure.