Skip to content

Commit

Permalink
Avoid overwriting first non-OK Status in db_stress setup (#8907)
Browse files Browse the repository at this point in the history
Summary: Pull Request resolved: #8907

Reviewed By: zhichao-cao

Differential Revision: D30922081

Pulled By: ajkr

fbshipit-source-id: ad7a32c21d0049342fd20c9b7f555e93674c3671
  • Loading branch information
ajkr authored and facebook-github-bot committed Sep 15, 2021
1 parent 7743f03 commit 5c92aa3
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions db_stress_tool/db_stress_test_base.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2643,7 +2643,7 @@ void StressTest::Open() {
assert(!s.ok() || column_families_.size() ==
static_cast<size_t>(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);
Expand All @@ -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;
Expand Down

0 comments on commit 5c92aa3

Please sign in to comment.