提交 1953b63c 编写于 作者: P Peter (Stig) Edwards 提交者: Facebook GitHub Bot

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
上级 532ff334
......@@ -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) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册