summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYu Zhang <yuzhangyu@fb.com>2024-09-27 14:53:53 -0700
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>2024-09-27 14:53:53 -0700
commit2c2776f1f396e0f23dd4d484b871144a2972d787 (patch)
treef6541055cbb39a628cb2464deb9be81fdb2594c1
parent79790cf2a80fb5e5b6799ebd69d3fb2ebe71d612 (diff)
Fix some missing values in stress test (#13039)
Summary: When `avoid_flush_during_shutdown` is false, DB will flush the memtables if there is some unpersisted data: https://github.com/facebook/rocksdb/blob/79790cf2a80fb5e5b6799ebd69d3fb2ebe71d612/db/db_impl/db_impl.cc#L505-L510 `has_unpersisted_data_` is a flag that is only turned on for when WAL is disabled, for example: https://github.com/facebook/rocksdb/blob/79790cf2a80fb5e5b6799ebd69d3fb2ebe71d612/db/db_impl/db_impl_write.cc#L525-L528 In other cases, it just has its default false value. So if disableWAL is false, and avoid_flush_during_shutdown is false, close won't flush memtables. Stress test is also not flush wal/sync wal. There could be missing data, while reopen in stress test doesn't tolerate missing data. To make the test simpler, this changes it to always flush/sync wal during reopen. Pull Request resolved: https://github.com/facebook/rocksdb/pull/13039 Reviewed By: hx235 Differential Revision: D63494695 Pulled By: jowlyzhang fbshipit-source-id: 8f0fd9ed50a482a3955abc0882257ecc2e95926d
-rw-r--r--db_stress_tool/db_stress_test_base.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/db_stress_tool/db_stress_test_base.cc b/db_stress_tool/db_stress_test_base.cc
index 5a4c310c4..2b6db414f 100644
--- a/db_stress_tool/db_stress_test_base.cc
+++ b/db_stress_tool/db_stress_test_base.cc
@@ -3674,7 +3674,7 @@ void StressTest::Reopen(ThreadState* thread) {
// crash-recovery verification does. Therefore it always expects no data loss
// and we should ensure no data loss in testing.
// TODO(hx235): eliminate the FlushWAL(true /* sync */)/SyncWAL() below
- if (!FLAGS_disable_wal && FLAGS_avoid_flush_during_shutdown) {
+ if (!FLAGS_disable_wal) {
Status s;
if (FLAGS_manual_wal_flush_one_in > 0) {
s = db_->FlushWAL(/*sync=*/true);