rocksdb/trace_replay
Andrew Kryczka aa2b3bf675 Added TraceOptions::preserve_write_order (#9334)
Summary:
This option causes trace records to be written in the serialized write thread. That way, the write records in the trace must follow the same order as writes that are logged to WAL and writes that are applied to the DB.

By default I left it disabled to match existing behavior. I enabled it in `db_stress`, though, as that use case requires order of write records in trace matches the order in WAL.

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

Test Plan:
- See if below unsynced data loss crash test can run  for 24h straight. It used to crash after a few hours when reaching an unlucky trace ordering.

```
DEBUG_LEVEL=0 TEST_TMPDIR=/dev/shm /usr/local/bin/python3 -u tools/db_crashtest.py blackbox --interval=10 --max_key=100000 --write_buffer_size=524288 --target_file_size_base=524288 --max_bytes_for_level_base=2097152 --value_size_mult=33 --sync_fault_injection=1 --test_batches_snapshots=0 --duration=86400
```

Reviewed By: zhichao-cao

Differential Revision: D33301990

Pulled By: ajkr

fbshipit-source-id: 82d97559727adb4462a7af69758449c8725b22d3
2021-12-28 15:04:26 -08:00
..
block_cache_tracer_test.cc Cleanup includes in dbformat.h (#8930) 2021-09-29 04:04:40 -07:00
block_cache_tracer.cc Make TraceRecord and Replayer public (#8611) 2021-08-11 19:32:46 -07:00
block_cache_tracer.h Use SystemClock* instead of std::shared_ptr<SystemClock> in lower level routines (#8033) 2021-03-15 04:34:11 -07:00
io_tracer_test.cc Cleanup includes in dbformat.h (#8930) 2021-09-29 04:04:40 -07:00
io_tracer.cc Add request_id in IODebugContext. (#8045) 2021-04-01 13:14:51 -07:00
io_tracer.h Make TraceRecord and Replayer public (#8611) 2021-08-11 19:32:46 -07:00
trace_record_handler.cc Replace std::shared_ptr<SystemClock> by SystemClock* in TraceExecutionHandler (#8729) 2021-08-31 11:24:27 -07:00
trace_record_handler.h Replace std::shared_ptr<SystemClock> by SystemClock* in TraceExecutionHandler (#8729) 2021-08-31 11:24:27 -07:00
trace_record_result.cc Add IteratorTraceExecutionResult for iterator related trace records. (#8687) 2021-08-20 15:35:56 -07:00
trace_record.cc Add IteratorTraceExecutionResult for iterator related trace records. (#8687) 2021-08-20 15:35:56 -07:00
trace_replay.cc Extend trace filtering to more operation types (#9335) 2021-12-28 11:46:30 -08:00
trace_replay.h Added TraceOptions::preserve_write_order (#9334) 2021-12-28 15:04:26 -08:00