From 5c92aa38eaa29041d0a6eb7b55a3f69db3ea5241 Mon Sep 17 00:00:00 2001 From: Andrew Kryczka Date: Wed, 15 Sep 2021 14:23:17 -0700 Subject: [PATCH] Avoid overwriting first non-OK Status in db_stress setup (#8907) Summary: Pull Request resolved: https://github.com/facebook/rocksdb/pull/8907 Reviewed By: zhichao-cao Differential Revision: D30922081 Pulled By: ajkr fbshipit-source-id: ad7a32c21d0049342fd20c9b7f555e93674c3671 --- db_stress_tool/db_stress_test_base.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/db_stress_tool/db_stress_test_base.cc b/db_stress_tool/db_stress_test_base.cc index 1a238f13c..90679483f 100644 --- a/db_stress_tool/db_stress_test_base.cc +++ b/db_stress_tool/db_stress_test_base.cc @@ -2643,7 +2643,7 @@ void StressTest::Open() { assert(!s.ok() || column_families_.size() == static_cast(FLAGS_column_families)); - if (FLAGS_test_secondary) { + if (s.ok() && FLAGS_test_secondary) { #ifndef ROCKSDB_LITE secondaries_.resize(FLAGS_threads); std::fill(secondaries_.begin(), secondaries_.end(), nullptr); @@ -2664,13 +2664,12 @@ void StressTest::Open() { break; } } - assert(s.ok()); #else fprintf(stderr, "Secondary is not supported in RocksDBLite\n"); exit(1); #endif } - if (FLAGS_continuous_verification_interval > 0 && !cmp_db_) { + if (s.ok() && FLAGS_continuous_verification_interval > 0 && !cmp_db_) { Options tmp_opts; // TODO(yanqin) support max_open_files != -1 for secondary instance. tmp_opts.max_open_files = -1; -- GitLab