rocksdb/db_stress_tool
Yanqin Jin 06394ff4e7 Fix a bug of CompactionIterator/CompactionFilter using Delete (#9929)
Summary:
When compaction filter determines that a key should be removed, it updates the internal key's type
to `Delete`. If this internal key is preserved in current compaction but seen by a later compaction
together with `SingleDelete`, it will cause compaction iterator to return Corruption.

To fix the issue, compaction filter should return more information in addition to the intention of removing
a key. Therefore, we add a new `kRemoveWithSingleDelete` to `CompactionFilter::Decision`. Seeing
`kRemoveWithSingleDelete`, compaction iterator will update the op type of the internal key to `kTypeSingleDelete`.

In addition, I updated db_stress_shared_state.[cc|h] so that `no_overwrite_ids_` becomes `const`. It is easier to
reason about thread-safety if accessed from multiple threads. This information is passed to `PrepareTxnDBOptions()`
when calling from `Open()` so that we can set up the rollback deletion type callback for transactions.

Finally, disable compaction filter for multiops_txn because the key removal logic of `DbStressCompactionFilter` does
not quite work with `MultiOpsTxnsStressTest`.

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

Test Plan:
make check
make crash_test
make crash_test_with_txn

Reviewed By: anand1976

Differential Revision: D36069678

Pulled By: riversand963

fbshipit-source-id: cedd2f1ba958af59ad3916f1ba6f424307955f92
2022-05-02 13:25:45 -07:00
..
batched_ops_stress.cc Revise APIs related to user-defined timestamp (#8946) 2022-02-01 22:19:01 -08:00
cf_consistency_stress.cc Add rate limiter priority to ReadOptions (#9424) 2022-02-16 23:18:14 -08:00
CMakeLists.txt Stress test for RocksDB transactions (#8936) 2021-12-14 13:34:43 -08: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 Add WAL compression to stress tests (#9811) 2022-04-06 15:47:09 -07:00
db_stress_compaction_filter.h Fix a bug of CompactionIterator/CompactionFilter using Delete (#9929) 2022-05-02 13:25:45 -07:00
db_stress_driver.cc Fix a bug of CompactionIterator/CompactionFilter using Delete (#9929) 2022-05-02 13:25:45 -07: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 Add WAL compression to stress tests (#9811) 2022-04-06 15:47:09 -07:00
db_stress_listener.cc Avoid usage of ReopenWritableFile in db_stress (#9649) 2022-03-04 10:30:10 -08:00
db_stress_listener.h Avoid usage of ReopenWritableFile in db_stress (#9649) 2022-03-04 10:30:10 -08:00
db_stress_shared_state.cc Fix a bug of CompactionIterator/CompactionFilter using Delete (#9929) 2022-05-02 13:25:45 -07:00
db_stress_shared_state.h Fix a bug of CompactionIterator/CompactionFilter using Delete (#9929) 2022-05-02 13:25:45 -07: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 Fix a bug of CompactionIterator/CompactionFilter using Delete (#9929) 2022-05-02 13:25:45 -07:00
db_stress_test_base.h Fix a bug of CompactionIterator/CompactionFilter using Delete (#9929) 2022-05-02 13:25:45 -07:00
db_stress_tool.cc db_stress: db_stress fails on custom filesystems. (#9352) 2022-01-25 16:22:58 -08:00
db_stress.cc Add (& fix) some simple source code checks (#8821) 2021-09-07 21:19:27 -07:00
expected_state.cc Add Temperature info in NewSequentialFile() (#9499) 2022-02-18 18:23:07 -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 Fix a bug of CompactionIterator/CompactionFilter using Delete (#9929) 2022-05-02 13:25:45 -07:00
multi_ops_txns_stress.h Fix a bug of CompactionIterator/CompactionFilter using Delete (#9929) 2022-05-02 13:25:45 -07:00
no_batched_ops_stress.cc Fix a bug of CompactionIterator/CompactionFilter using Delete (#9929) 2022-05-02 13:25:45 -07:00