Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix stress test failure due to write fault injections and disable write fault injection #11859

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion db_stress_tool/db_stress_test_base.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2693,7 +2693,9 @@ void StressTest::Open(SharedState* shared, bool reopen) {

// If this is for DB reopen, write error injection may have been enabled.
// Disable it here in case there is no open fault injection.
fault_fs_guard->DisableWriteErrorInjection();
if (fault_fs_guard) {
fault_fs_guard->DisableWriteErrorInjection();
}
if (!FLAGS_use_txn) {
// Determine whether we need to inject file metadata write failures
// during DB reopen. If it does, enable it.
Expand Down
4 changes: 2 additions & 2 deletions tools/db_crashtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@
"max_key_len": 3,
"key_len_percent_dist": "1,30,69",
"read_fault_one_in": lambda: random.choice([0, 32, 1000]),
"write_fault_one_in": lambda: random.choice([0, 500]),
"write_fault_one_in": 0,
"open_metadata_write_fault_one_in": lambda: random.choice([0, 0, 8]),
"open_write_fault_one_in": lambda: random.choice([0, 0, 16]),
"open_read_fault_one_in": lambda: random.choice([0, 0, 32]),
Expand Down Expand Up @@ -681,7 +681,7 @@ def finalize_and_sanitize(src_params):
dest_params["verify_file_checksums_one_in"] = 0
if dest_params["write_fault_one_in"] > 0:
# background work may be disabled while DB is resuming after some error
dest_params["max_write_buffer_number"] = max(dest_params["max_write_buffer_number"], 6)
dest_params["max_write_buffer_number"] = max(dest_params["max_write_buffer_number"], 10)
return dest_params


Expand Down
Loading