From 657df29eafb0d34cab1c757d32bf9ad1b5dd1daf Mon Sep 17 00:00:00 2001 From: Andrew Kryczka Date: Fri, 7 Jul 2017 18:11:53 -0700 Subject: [PATCH] Add max_background_jobs to db_bench Summary: As titled. Also fixed an off-by-one error causing us to add one less range deletion than the user specified. Closes https://github.com/facebook/rocksdb/pull/2544 Differential Revision: D5383451 Pulled By: ajkr fbshipit-source-id: cbd5890c33f09bbb5c0c1f4bb952a1add32336e0 --- tools/db_bench_tool.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/db_bench_tool.cc b/tools/db_bench_tool.cc index 2f3946ac2c..5724a39ca9 100644 --- a/tools/db_bench_tool.cc +++ b/tools/db_bench_tool.cc @@ -313,6 +313,11 @@ DEFINE_int32(max_write_buffer_number_to_maintain, "after they are flushed. If this value is set to -1, " "'max_write_buffer_number' will be used."); +DEFINE_int32(max_background_jobs, + rocksdb::Options().max_background_jobs, + "The maximum number of concurrent background jobs that can occur " + "in parallel."); + DEFINE_int32(max_background_compactions, rocksdb::Options().max_background_compactions, "The maximum number of concurrent background compactions" @@ -2855,6 +2860,7 @@ void VerifyDBFromDB(std::string& truth_db_name) { FLAGS_min_write_buffer_number_to_merge; options.max_write_buffer_number_to_maintain = FLAGS_max_write_buffer_number_to_maintain; + options.max_background_jobs = FLAGS_max_background_jobs; options.max_background_compactions = FLAGS_max_background_compactions; options.max_subcompactions = static_cast(FLAGS_subcompactions); options.max_background_flushes = FLAGS_max_background_flushes; @@ -3494,7 +3500,7 @@ void VerifyDBFromDB(std::string& truth_db_name) { bytes += value_size_ + key_size_; ++num_written; if (writes_per_range_tombstone_ > 0 && - num_written / writes_per_range_tombstone_ < + num_written / writes_per_range_tombstone_ <= max_num_range_tombstones_ && num_written % writes_per_range_tombstone_ == 0) { int64_t begin_num = key_gens[id]->Next();