rocksdb/db_stress_tool
Andrew Kryczka c7ce03dce1 db_stress begin tracking expected state after verification (#9470)
Summary:
Previously we enabled tracking expected state changes during
`FinishInitDb()`, as soon as the DB was opened. This meant tracing was
enabled during `VerifyDb()`. This cost extra CPU by requiring
`DBImpl::trace_mutex_` to be acquired on each read operation. It was
unnecessary since we know there are no expected state changes during the
`VerifyDb()` phase. So, this PR delays tracking expected state changes
until after the `VerifyDb()` phase has completed.

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

Test Plan:
Measured this PR reduced `VerifyDb()` 76% (387 -> 92 seconds) with
`-disable_wal=1` (i.e., expected state tracking enabled).

- benchmark command: `./db_stress -max_key=100000000 -ops_per_thread=1 -destroy_db_initially=1 -expected_values_dir=/dev/shm/dbstress_expected/ -db=/dev/shm/dbstress/ --clear_column_family_one_in=0 --disable_wal=1 --reopen=0`
- without this PR, `VerifyDb()` takes 387 seconds:

```
2022/01/30-21:43:04  Initializing worker threads
Crash-recovery verification passed :)
2022/01/30-21:49:31  Starting database operations
```

- with this PR, `VerifyDb()` takes 92 seconds

```
2022/01/30-21:59:06  Initializing worker threads
Crash-recovery verification passed :)
2022/01/30-22:00:38  Starting database operations
```

Reviewed By: riversand963

Differential Revision: D33884596

Pulled By: ajkr

fbshipit-source-id: 5f259de8087de5b0531f088e11297f37ed2f7685
2022-01-31 13:35:32 -08:00
..
CMakeLists.txt Stress test for RocksDB transactions (#8936) 2021-12-14 13:34:43 -08:00
batched_ops_stress.cc db_stress print hex key for MultiGet() inconsistency (#9324) 2021-12-20 23:29:43 -08:00
cf_consistency_stress.cc db_stress support tracking historical values (#8960) 2021-12-07 13:41:48 -08:00
db_stress.cc Add (& fix) some simple source code checks (#8821) 2021-09-07 21:19:27 -07:00
db_stress_common.cc db_stress: db_stress fails on custom filesystems. (#9352) 2022-01-25 16:22:58 -08:00
db_stress_common.h Remove obsolete backupable_db.h, utility_db.h (#9438) 2022-01-27 15:45:30 -08:00
db_stress_compaction_filter.h Prevent deadlock in db_stress with DbStressCompactionFilter (#8956) 2021-09-24 16:54:02 -07:00
db_stress_driver.cc db_stress begin tracking expected state after verification (#9470) 2022-01-31 13:35:32 -08:00
db_stress_driver.h Replace namespace name "rocksdb" with ROCKSDB_NAMESPACE (#6433) 2020-02-20 12:09:57 -08:00
db_stress_env_wrapper.h Make the Env class Customizable (#9293) 2022-01-04 16:45:49 -08:00
db_stress_gflags.cc Move HDFS support to separate repo (#9170) 2022-01-24 20:23:54 -08:00
db_stress_listener.cc db_stress: db_stress fails on custom filesystems. (#9352) 2022-01-25 16:22:58 -08:00
db_stress_listener.h db_stress: db_stress fails on custom filesystems. (#9352) 2022-01-25 16:22:58 -08:00
db_stress_shared_state.cc Silence false alarms in db_stress fault injection (#6741) 2020-04-24 13:06:12 -07:00
db_stress_shared_state.h Set the number of threads up front in db_stress (#9466) 2022-01-29 10:45:41 -08:00
db_stress_stat.cc Fix Statistics in db_stress (#9260) 2021-12-07 16:24:22 -08:00
db_stress_stat.h Fix Statistics in db_stress (#9260) 2021-12-07 16:24:22 -08:00
db_stress_table_properties_collector.h Fix and detect headers with missing dependencies (#8893) 2021-09-10 10:00:26 -07:00
db_stress_test_base.cc db_stress begin tracking expected state after verification (#9470) 2022-01-31 13:35:32 -08:00
db_stress_test_base.h db_stress begin tracking expected state after verification (#9470) 2022-01-31 13:35:32 -08:00
db_stress_tool.cc db_stress: db_stress fails on custom filesystems. (#9352) 2022-01-25 16:22:58 -08:00
expected_state.cc Added `TraceOptions::preserve_write_order` (#9334) 2021-12-28 15:04:26 -08:00
expected_state.h db_stress verify with lost unsynced operations (#8966) 2021-12-15 12:54:44 -08:00
multi_ops_txns_stress.cc Make the Env class Customizable (#9293) 2022-01-04 16:45:49 -08:00
multi_ops_txns_stress.h Stress test for RocksDB transactions (#8936) 2021-12-14 13:34:43 -08:00
no_batched_ops_stress.cc db_stress support tracking historical values (#8960) 2021-12-07 13:41:48 -08:00