The db_stress test should also test multi-threaded compaction.

Summary:
Create more than one background compaction thread if specified.
This code peice is similar to what exists in db_bench.

Test Plan: make check

Differential Revision: https://reviews.facebook.net/D6753
This commit is contained in:
Dhruba Borthakur 2012-11-14 22:00:11 -08:00
parent 6c5a4d646a
commit c3392c9fe0
1 changed files with 4 additions and 0 deletions

View File

@ -879,6 +879,10 @@ int main(int argc, char** argv) {
} }
} }
// The number of background threads should be at least as much the
// max number of concurrent compactions.
FLAGS_env->SetBackgroundThreads(FLAGS_max_background_compactions);
if ((FLAGS_readpercent + FLAGS_delpercent) > 100) { if ((FLAGS_readpercent + FLAGS_delpercent) > 100) {
fprintf(stderr, "Error: Read + Delete percents > 100!\n"); fprintf(stderr, "Error: Read + Delete percents > 100!\n");
exit(1); exit(1);