From 26f68d3939e398004c7e66f17a069c0bd4d85d96 Mon Sep 17 00:00:00 2001 From: Mayank Agarwal Date: Mon, 8 Apr 2013 11:50:44 -0700 Subject: [PATCH] db_stress #reopens should be less than ops_per_thread Summary: For sanity w.r.t. the way we split up the reopens equally among the ops/thread Test Plan: make db_stress; db_stress --ops_per_thread=10 --reopens=10 => error Reviewers: vamsi, dhruba Reviewed By: dhruba CC: leveldb Differential Revision: https://reviews.facebook.net/D10023 --- tools/db_stress.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/db_stress.cc b/tools/db_stress.cc index b5ad3ed1e..0d80f0719 100644 --- a/tools/db_stress.cc +++ b/tools/db_stress.cc @@ -1121,6 +1121,13 @@ int main(int argc, char** argv) { exit(1); } + if ((unsigned)FLAGS_reopen >= FLAGS_ops_per_thread) { + fprintf(stderr, "Error: #DB-reopens should be < ops_per_thread\n" + "Provided reopens = %d and ops_per_thread = %u\n", FLAGS_reopen, + FLAGS_ops_per_thread); + exit(1); + } + // Choose a location for the test database if none given with --db= if (FLAGS_db == nullptr) { leveldb::Env::Default()->GetTestDirectory(&default_db_path);