rocksdb/tools
Hui Xiao 3b8164912e Add manual_wal_flush, FlushWAL() to stress/crash test (#10698)
Summary:
**Context/Summary:**
Introduce `manual_wal_flush_one_in` as titled.
- When `manual_wal_flush_one_in  > 0`, we also need tracing to correctly verify recovery because WAL data can be lost in this case when `FlushWAL()` is not explicitly called by users of RocksDB (in our case, db stress) and the recovery from such potential WAL data loss is a prefix recovery that requires tracing to verify. As another consequence, we need to disable features can't run under unsync data loss with `manual_wal_flush_one_in`

Incompatibilities fixed along the way:
```
db_stress: db/db_impl/db_impl_open.cc:2063: static rocksdb::Status rocksdb::DBImpl::Open(const rocksdb::DBOptions&, const string&, const std::vector<rocksdb::ColumnFamilyDescriptor>&, std::vector<rocksdb::ColumnFamilyHandle*>*, rocksdb::DB**, bool, bool): Assertion `impl->TEST_WALBufferIsEmpty()' failed.
```
 - It turns out that `Writer::AddCompressionTypeRecord` before this assertion `EmitPhysicalRecord(kSetCompressionType, encode.data(), encode.size());` but do not trigger flush if `manual_wal_flush` is set . This leads to `impl->TEST_WALBufferIsEmpty()' is false.
    - As suggested, assertion is removed and violation case is handled by `FlushWAL(sync=true)` along with refactoring `TEST_WALBufferIsEmpty()` to be `WALBufferIsEmpty()` since it is used in prod code now.

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

Test Plan:
- Locally running `python3 tools/db_crashtest.py blackbox --manual_wal_flush_one_in=1 --manual_wal_flush=1 --sync_wal_one_in=100 --atomic_flush=1 --flush_one_in=100 --column_families=3`
- Joined https://github.com/facebook/rocksdb/pull/10624 in auto CI testings with all RocksDB stress/crash test jobs

Reviewed By: ajkr

Differential Revision: D39593752

Pulled By: ajkr

fbshipit-source-id: 3a2135bb792c52d2ffa60257d4fbc557fb04d2ce
2022-09-30 15:48:33 -07:00
..
advisor Fix lint issues after enable BLACK (#10717) 2022-09-21 13:37:51 -07:00
block_cache_analyzer Enable BLACK for internal_repo_rocksdb (#10710) 2022-09-20 17:47:52 -07:00
dump
analyze_txn_stress_test.sh
auto_sanity_test.sh
backup_db.sh
benchmark.sh Add a blob-specific cache priority (#10461) 2022-08-12 17:59:06 -07:00
benchmark_ci.py Enable BLACK for internal_repo_rocksdb (#10710) 2022-09-20 17:47:52 -07:00
benchmark_compare.sh CI benchmarks refine configuration (#10514) 2022-08-25 09:47:03 -07:00
benchmark_leveldb.sh
blob_dump.cc
check_all_python.py Enable BLACK for internal_repo_rocksdb (#10710) 2022-09-20 17:47:52 -07:00
check_format_compatible.sh Post 7.6 branch cut changes (#10546) 2022-08-21 20:42:12 -07:00
CMakeLists.txt
db_bench.cc
db_bench_tool.cc Call experimental new clock cache HyperClockCache (#10684) 2022-09-16 12:47:29 -07:00
db_bench_tool_test.cc
db_crashtest.py Add manual_wal_flush, FlushWAL() to stress/crash test (#10698) 2022-09-30 15:48:33 -07:00
db_repl_stress.cc
db_sanity_test.cc Migrate to docker for CI run (#10496) 2022-08-10 17:34:38 -07:00
dbench_monitor
Dockerfile
generate_random_db.sh
ingest_external_sst.sh
io_tracer_parser.cc
io_tracer_parser_test.cc
io_tracer_parser_tool.cc
io_tracer_parser_tool.h
ldb.cc
ldb_cmd.cc Sync dir containing CURRENT after RenameFile on CURRENT as much as possible (#10573) 2022-08-29 17:35:21 -07:00
ldb_cmd_impl.h
ldb_cmd_test.cc Migrate to docker for CI run (#10496) 2022-08-10 17:34:38 -07:00
ldb_test.py Enable BLACK for internal_repo_rocksdb (#10710) 2022-09-20 17:47:52 -07:00
ldb_tool.cc
pflag
reduce_levels_test.cc Migrate to docker for CI run (#10496) 2022-08-10 17:34:38 -07:00
regression_test.sh
restore_db.sh
rocksdb_dump_test.sh
run_blob_bench.sh
run_flash_bench.sh
run_leveldb.sh
sample-dump.dmp
simulated_hybrid_file_system.cc
simulated_hybrid_file_system.h
sst_dump.cc
sst_dump_test.cc
sst_dump_tool.cc
trace_analyzer.cc
trace_analyzer_test.cc
trace_analyzer_tool.cc fix trace_analyzer_tool args column position (#10576) 2022-08-26 08:44:52 -07:00
trace_analyzer_tool.h
verify_random_db.sh
write_external_sst.sh
write_stress.cc
write_stress_runner.py Enable BLACK for internal_repo_rocksdb (#10710) 2022-09-20 17:47:52 -07:00