From 1953b63cddf1a6779e7a7cfd7d28920b59ef6b6a Mon Sep 17 00:00:00 2001 From: "Peter (Stig) Edwards" Date: Thu, 30 Sep 2021 14:16:23 -0700 Subject: [PATCH] ErrorExit if num<1000 for fillsync and fill100K (#8391) Summary: This is to avoid an exception and core dump when running db_bench -benchmarks fillsync -num 999 https://github.com/facebook/rocksdb/issues/8390 Pull Request resolved: https://github.com/facebook/rocksdb/pull/8391 Reviewed By: pdillinger Differential Revision: D29139688 Pulled By: mrambacher fbshipit-source-id: b9e306728ad25a7aac75f6154699aa852bc07bd1 --- tools/db_bench_tool.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/db_bench_tool.cc b/tools/db_bench_tool.cc index 0fe1c1e93..e8ed9bff1 100644 --- a/tools/db_bench_tool.cc +++ b/tools/db_bench_tool.cc @@ -4736,10 +4736,10 @@ class Benchmark { } Duration duration(test_duration, max_ops, ops_per_stage); + const uint64_t num_per_key_gen = num_ + max_num_range_tombstones_; for (size_t i = 0; i < num_key_gens; i++) { key_gens[i].reset(new KeyGenerator(&(thread->rand), write_mode, - num_ + max_num_range_tombstones_, - ops_per_stage)); + num_per_key_gen, ops_per_stage)); } if (num_ != FLAGS_num) { @@ -4849,7 +4849,7 @@ class Benchmark { int64_t stage = 0; int64_t num_written = 0; - while (!duration.Done(entries_per_batch_)) { + while ((num_per_key_gen != 0) && !duration.Done(entries_per_batch_)) { if (duration.GetStage() != stage) { stage = duration.GetStage(); if (db_.db != nullptr) { -- GitLab