From c3392c9fe0f8e188a33878e9b6007769af5c57a5 Mon Sep 17 00:00:00 2001 From: Dhruba Borthakur Date: Wed, 14 Nov 2012 22:00:11 -0800 Subject: [PATCH] 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 --- tools/db_stress.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/db_stress.cc b/tools/db_stress.cc index e2dda2d52..2aa38cb0f 100644 --- a/tools/db_stress.cc +++ b/tools/db_stress.cc @@ -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) { fprintf(stderr, "Error: Read + Delete percents > 100!\n"); exit(1); -- GitLab