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
This commit is contained in:
Peter (Stig) Edwards 2021-09-30 14:16:23 -07:00 committed by Facebook GitHub Bot
parent 532ff334d9
commit 1953b63cdd

View File

@ -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) {