From 1aae41786aedcd77234fa3908202a0538419c542 Mon Sep 17 00:00:00 2001 From: Cheng Chang Date: Fri, 13 Nov 2020 13:36:00 -0800 Subject: [PATCH] Do not track WAL in MANIFEST when fsync is disabled in a test (#7669) Summary: If fsync is disabled in a unit test, then do not track WAL in MANIFEST, because on DB recovery, the WAL might be missing because the directory is not fsynced. Pull Request resolved: https://github.com/facebook/rocksdb/pull/7669 Test Plan: Tests with fsync enabled should pass. Reviewed By: riversand963 Differential Revision: D24941431 Pulled By: cheng-chang fbshipit-source-id: ab3ff0f90769795cfb4e4d6dcf084ea5545d1975 --- db/db_test_util.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/db/db_test_util.cc b/db/db_test_util.cc index 42c557643..8c57db1bf 100644 --- a/db/db_test_util.cc +++ b/db/db_test_util.cc @@ -340,7 +340,9 @@ Options DBTestBase::GetDefaultOptions() const { options.wal_recovery_mode = WALRecoveryMode::kTolerateCorruptedTailRecords; options.compaction_pri = CompactionPri::kByCompensatedSize; options.env = env_; - options.track_and_verify_wals_in_manifest = true; + if (!env_->skip_fsync_) { + options.track_and_verify_wals_in_manifest = true; + } return options; }