Complete the fix of stress open WAL drop fix (#8570)

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
main
sdong 3 years ago committed by Facebook GitHub Bot
parent 42eaa45c1b
commit 9b41082d4a
  1. 14
      db_stress_tool/db_stress_test_base.cc

@ -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(

Loading…
Cancel
Save