Disable db_stress features incompatible with unsynced data dropping when sync_fault_injection=1 (#10559)

Summary:
The features that cannot work with disable_wal=1 due to unsynced data dropping (ingest_external_file_one_in and enable_compaction_filter) similarly cannot work with sync_fault_injection=1. This PR prevents those features from being used together with sync_fault_injection=1.

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

Reviewed By: hx235

Differential Revision: D38953019

Pulled By: ajkr

fbshipit-source-id: 7e2c7644ec84d7323f632cf976bcee00502d0ed7
main
Andrew Kryczka 2 years ago committed by Facebook GitHub Bot
parent d140fbfd7d
commit d95e376368
  1. 25
      tools/db_crashtest.py

@ -485,25 +485,26 @@ def finalize_and_sanitize(src_params):
dest_params["delpercent"] += dest_params["delrangepercent"] dest_params["delpercent"] += dest_params["delrangepercent"]
dest_params["delrangepercent"] = 0 dest_params["delrangepercent"] = 0
dest_params["ingest_external_file_one_in"] = 0 dest_params["ingest_external_file_one_in"] = 0
# File ingestion does not guarantee prefix-recoverability with WAL disabled. if (dest_params.get("disable_wal") == 1 or
# Ingesting a file persists data immediately that is newer than memtable dest_params.get("sync_fault_injection") == 1):
# data that can be lost on restart. # File ingestion does not guarantee prefix-recoverability when unsynced
# # data can be lost. Ingesting a file syncs data immediately that is
# Even if the above issue is fixed or worked around, our trace-and-replay # newer than unsynced memtable data that can be lost on restart.
# does not trace file ingestion, so in its current form it would not recover #
# the expected state to the correct point in time. # Even if the above issue is fixed or worked around, our
if (dest_params.get("disable_wal") == 1): # trace-and-replay does not trace file ingestion, so in its current form
# it would not recover the expected state to the correct point in time.
dest_params["ingest_external_file_one_in"] = 0 dest_params["ingest_external_file_one_in"] = 0
# The `DbStressCompactionFilter` can apply memtable updates to SST
# files, which would be problematic when unsynced data can be lost in
# crash recoveries.
dest_params["enable_compaction_filter"] = 0
# Only under WritePrepared txns, unordered_write would provide the same guarnatees as vanilla rocksdb # Only under WritePrepared txns, unordered_write would provide the same guarnatees as vanilla rocksdb
if dest_params.get("unordered_write", 0) == 1: if dest_params.get("unordered_write", 0) == 1:
dest_params["txn_write_policy"] = 1 dest_params["txn_write_policy"] = 1
dest_params["allow_concurrent_memtable_write"] = 1 dest_params["allow_concurrent_memtable_write"] = 1
if dest_params.get("disable_wal", 0) == 1: if dest_params.get("disable_wal", 0) == 1:
dest_params["atomic_flush"] = 1 dest_params["atomic_flush"] = 1
# The `DbStressCompactionFilter` can apply memtable updates to SST
# files, which would be problematic without WAL since such updates are
# expected to be lost in crash recoveries.
dest_params["enable_compaction_filter"] = 0
dest_params["sync"] = 0 dest_params["sync"] = 0
dest_params["write_fault_one_in"] = 0 dest_params["write_fault_one_in"] = 0
if dest_params.get("open_files", 1) != -1: if dest_params.get("open_files", 1) != -1:

Loading…
Cancel
Save