From 3827403c5179b0146fc97cf3efb395cb050a58c2 Mon Sep 17 00:00:00 2001 From: Mayank Agarwal Date: Tue, 21 May 2013 11:27:23 -0700 Subject: [PATCH] Check to db_stress to not allow disable_wal and reopens set together Summary: db can't reopen safely with disable_wal set! Test Plan: make db_stress; run db_stress with disable_wal and reopens set and see error Reviewers: dhruba, vamsi Reviewed By: dhruba CC: leveldb Differential Revision: https://reviews.facebook.net/D10857 --- tools/db_stress.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/db_stress.cc b/tools/db_stress.cc index eb4a1f892..54ab9c218 100644 --- a/tools/db_stress.cc +++ b/tools/db_stress.cc @@ -1152,7 +1152,10 @@ int main(int argc, char** argv) { fprintf(stderr, "Error: Read + Delete percents > 100!\n"); exit(1); } - + if (FLAGS_disable_wal == 1 && FLAGS_reopen > 0) { + fprintf(stderr, "Error: Db cannot reopen safely with disable_wal set!\n"); + 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,