mirror of https://github.com/facebook/rocksdb.git
9c932816cf
Summary: db_stress asserts/seg-faults with below command (on debug and release builds) ``` "rm -rf /tmp/rocksdbtest*; db_stress --ops_per_thread=1000 --reopen=5" ======================================= Error opening unique id file for append: IO error: No such file or directory: While open a file for appending: /tmp/rocksdbtest-0/dbstress/.unique_ids: No such file or directory Choosing random keys with no overwrite Creating 2621440 locks Starting continuous_verification_thread 2021/11/15-08:46:49 Initializing worker threads 2021/11/15-08:46:49 Starting database operations 2021/11/15-08:46:49 Reopening database for the 1th time WARNING: prefix_size is non-zero but memtablerep != prefix_hash DB path: [/tmp/rocksdbtest-0/dbstress] Segmentation fault ======================================= ``` StressTest() constructor deletes the directory "dbstress" because the option --destroy_db_initially is true by default in db_stress. This Seg fault happens on a new database, UniqueIdVerifier's constructor tries to read the ".unique_ids" file, if the file is not present, ReopenWritableFile() tries to create .unique_ids file, but fails as the directory db_stress is not available. The data_file_writer_ is set as an invalid(null) pointer and in subsequent calls (~UniqueIdVerifier() and UniqueIdVerifier::Verify()) it accesses this null pointer and crashes. This patch creates db_stress directory if it is missing, so the .unique_ids file is created. Signed-off-by: Aravind Ramesh <aravind.ramesh@wdc.com> Pull Request resolved: https://github.com/facebook/rocksdb/pull/9219 Reviewed By: ajkr Differential Revision: D32730151 Pulled By: pdillinger fbshipit-source-id: f47baba56b380d93c3ba5608904756e86bbf14f5 |
||
---|---|---|
.. | ||
CMakeLists.txt | ||
batched_ops_stress.cc | ||
cf_consistency_stress.cc | ||
db_stress.cc | ||
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.h | ||
db_stress_table_properties_collector.h | ||
db_stress_test_base.cc | ||
db_stress_test_base.h | ||
db_stress_tool.cc | ||
expected_state.cc | ||
expected_state.h | ||
no_batched_ops_stress.cc |