]> git-server-git.apps.pok.os.sepia.ceph.com Git - rocksdb.git/commitdiff
Complete the fix of stress open WAL drop fix (#8570)
authorsdong <siying.d@fb.com>
Wed, 21 Jul 2021 23:07:18 +0000 (16:07 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Wed, 21 Jul 2021 23:08:53 +0000 (16:08 -0700)
Summary:
https://github.com/facebook/rocksdb/pull/8548 is not complete. We should instead cover all cases writable files are buffered, not just when failures are ingested. Extend it to any case where failures are ingested in DB open.

Pull Request resolved: https://github.com/facebook/rocksdb/pull/8570

Test Plan: Run db_stress and see it doesn't break

Reviewed By: jay-zhuang

Differential Revision: D29830415

fbshipit-source-id: 94449a0468fb2f7eec17423724008c9c63b2445d

db_stress_tool/db_stress_test_base.cc

index 777b9581327e8e24913627473be16b087e11ae47..c2dd8b85bc7168097d629e9afb8dd824416926b6 100644 (file)
@@ -2491,6 +2491,13 @@ void StressTest::Open() {
           fault_fs_guard
               ->FileExists(FLAGS_db + "/CURRENT", IOOptions(), nullptr)
               .ok()) {
+        if (!FLAGS_sync) {
+          // When DB Stress is not sync mode, we expect all WAL writes to
+          // WAL is durable. Buffering unsynced writes will cause false
+          // positive in crash tests. Before we figure out a way to
+          // solve it, skip WAL from failure injection.
+          fault_fs_guard->SetSkipDirectWritableTypes({kWalFile});
+        }
         ingest_meta_error = FLAGS_open_metadata_write_fault_one_in;
         ingest_write_error = FLAGS_open_write_fault_one_in;
         ingest_read_error = FLAGS_open_read_fault_one_in;
@@ -2500,13 +2507,6 @@ void StressTest::Open() {
               FLAGS_open_metadata_write_fault_one_in);
         }
         if (ingest_write_error) {
-          if (!FLAGS_sync) {
-            // When DB Stress is not sync mode, we expect all WAL writes to
-            // WAL is durable. Buffering unsynced writes will cause false
-            // positive in crash tests. Before we figure out a way to
-            // solve it, skip WAL from failure injection.
-            fault_fs_guard->SetSkipDirectWritableTypes({kWalFile});
-          }
           fault_fs_guard->SetFilesystemDirectWritable(false);
           fault_fs_guard->EnableWriteErrorInjection();
           fault_fs_guard->SetRandomWriteError(