From 793fd097838fe6e25e0ac33744b7adad63eb0c16 Mon Sep 17 00:00:00 2001 From: anand76 Date: Fri, 30 Sep 2022 13:37:05 -0700 Subject: [PATCH] Track expected state only if expected values dir is non-empty (#10764) Summary: If the `-expected_values_dir` argument to db_stress is empty, then verification against expected state is effectively disabled. But `RunStressTest` still calls `TrackExpectedState`, which returns `NotSupported` causing a the crash test to fail with a false alarm. Fix it by only calling `TrackExpectedState` if necessary. Pull Request resolved: https://github.com/facebook/rocksdb/pull/10764 Reviewed By: ajkr Differential Revision: D39980129 Pulled By: anand1976 fbshipit-source-id: d02651746fe3a297877a4b2b2fbcb7274860f49c --- db_stress_tool/db_stress_driver.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/db_stress_tool/db_stress_driver.cc b/db_stress_tool/db_stress_driver.cc index b4856b347..ed1240e00 100644 --- a/db_stress_tool/db_stress_driver.cc +++ b/db_stress_tool/db_stress_driver.cc @@ -143,7 +143,9 @@ bool RunStressTest(StressTest* stress) { // This is after the verification step to avoid making all those `Get()`s // and `MultiGet()`s contend on the DB-wide trace mutex. - stress->TrackExpectedState(&shared); + if (!FLAGS_expected_values_dir.empty()) { + stress->TrackExpectedState(&shared); + } now = clock->NowMicros(); fprintf(stdout, "%s Starting database operations\n",