84228e21e8
Summary: The `SharedState` constructor had an early return in case of `-test_batches_snapshots=1`. This early return caused `num_bg_threads_` to never be incremented. Consequently, the driver thread could cleanup objects like the `SharedState` while BG threads were still running and accessing it, leading to crash. The fix is to move the logic for counting threads (both FG and BG) to the place they are launched. That way we can be sure the counts are consistent, at least for now. Pull Request resolved: https://github.com/facebook/rocksdb/pull/9313 Test Plan: below command used to fail, now it passes. ``` $ ./db_stress --db=./test-db/ --expected_values_dir=./test-db-expected/ --max_key=100000 --ops_per_thread=1000 --sync_fault_injection=1 --clear_column_family_one_in=0 --destroy_db_initially=0 -reopen=0 -test_batches_snapshots=1 ``` Reviewed By: jay-zhuang Differential Revision: D33198670 Pulled By: ajkr fbshipit-source-id: 126592dc1eb31998bc8f82ffbf5a0d4eb8dec317 |
||
---|---|---|
.. | ||
batched_ops_stress.cc | ||
cf_consistency_stress.cc | ||
CMakeLists.txt | ||
db_stress_common.cc | ||
db_stress_common.h | ||
db_stress_compaction_filter.h | ||
db_stress_driver.cc | ||
db_stress_driver.h | ||
db_stress_env_wrapper.h | ||
db_stress_gflags.cc | ||
db_stress_listener.cc | ||
db_stress_listener.h | ||
db_stress_shared_state.cc | ||
db_stress_shared_state.h | ||
db_stress_stat.cc | ||
db_stress_stat.h | ||
db_stress_table_properties_collector.h | ||
db_stress_test_base.cc | ||
db_stress_test_base.h | ||
db_stress_tool.cc | ||
db_stress.cc | ||
expected_state.cc | ||
expected_state.h | ||
multi_ops_txns_stress.cc | ||
multi_ops_txns_stress.h | ||
no_batched_ops_stress.cc |