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

Try to deflake unit test RoundRobinSubcompactionsAgainstPressureToken #13254

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

cbi42
Copy link
Member

@cbi42 cbi42 commented Dec 27, 2024

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.

@@ -6446,21 +6446,34 @@ TEST_P(RoundRobinSubcompactionsAgainstPressureToken, PressureTokenTest) {
ASSERT_EQ(kFilesPerLevel, NumTableFilesAtLevel(lvl, 0));
}

bool compaction_num_verified = false;
Copy link
Contributor

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;
Copy link
Contributor

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

Copy link
Contributor

@hx235 hx235 left a 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants