rocksdb/utilities/transactions
rogertyang 543191f2ea Add bounds checking to WBWIIteratorImpl and respect bounds of ReadOptions in Transaction (#11680)
Summary:
Fix https://github.com/facebook/rocksdb/issues/11607
Fix https://github.com/facebook/rocksdb/issues/11679
Fix https://github.com/facebook/rocksdb/issues/11606
Fix https://github.com/facebook/rocksdb/issues/2343

Add bounds checking to `WBWIIteratorImpl`, which will be reflected in `BaseDeltaIterator::delta_iterator_::Valid()`, just like `BaseDeltaIterator::base_iterator_::Valid()`. In this way, the two sub itertors become more aligned from `BaseDeltaIterator`'s perspective. Like `DBIter`, the added bounds checking caps in either bound when seeking and disvalidates the `WBWIIteratorImpl` iterator when the lower bound is past or the upper bound is reached.

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

Test Plan:
- A simple test added to write_batch_with_index_test.cc to exercise the bounds checking in `WBWIIteratorImpl`.
- A sophisticated test added to transaction_test.cc to assert that `Transaction` with different write policies honor bounds in `ReadOptions`. It should be so as long as the  `BaseDeltaIterator` is correctly coordinating the two sub iterators to perform iterating and bounds checking.

Reviewed By: ajkr

Differential Revision: D48125229

Pulled By: cbi42

fbshipit-source-id: c9acea52595aed1471a63d7ca6ef15d2a2af1367
2023-10-20 13:28:28 -07:00
..
lock Add missing status check when compiling with `ASSERT_STATUS_CHECKED=1` (#11686) 2023-08-09 15:46:44 -07:00
optimistic_transaction.cc Improve memory efficiency of many OptimisticTransactionDBs (#11439) 2023-05-24 11:57:15 -07:00
optimistic_transaction.h Remove RocksDB LITE (#11147) 2023-01-27 13:14:19 -08:00
optimistic_transaction_db_impl.cc Improve memory efficiency of many OptimisticTransactionDBs (#11439) 2023-05-24 11:57:15 -07:00
optimistic_transaction_db_impl.h Improve memory efficiency of many OptimisticTransactionDBs (#11439) 2023-05-24 11:57:15 -07:00
optimistic_transaction_test.cc Use *next_sequence -1 here (#11861) 2023-09-21 13:52:01 -07:00
pessimistic_transaction.cc Add Transaction::CollapseKey to collapse merge op chains ondemand (#11815) 2023-09-15 10:25:57 -07:00
pessimistic_transaction.h Add Transaction::CollapseKey to collapse merge op chains ondemand (#11815) 2023-09-15 10:25:57 -07:00
pessimistic_transaction_db.cc Remove RocksDB LITE (#11147) 2023-01-27 13:14:19 -08:00
pessimistic_transaction_db.h Remove RocksDB LITE (#11147) 2023-01-27 13:14:19 -08:00
snapshot_checker.cc Remove RocksDB LITE (#11147) 2023-01-27 13:14:19 -08:00
timestamped_snapshot_test.cc Remove RocksDB LITE (#11147) 2023-01-27 13:14:19 -08:00
transaction_base.cc Set default cf ts sz for a reused transaction (#11685) 2023-08-09 13:49:42 -07:00
transaction_base.h Group rocksdb.sst.read.micros stat by different user read IOActivity + misc (#11444) 2023-08-08 17:26:50 -07:00
transaction_db_mutex_impl.cc Remove RocksDB LITE (#11147) 2023-01-27 13:14:19 -08:00
transaction_db_mutex_impl.h Remove RocksDB LITE (#11147) 2023-01-27 13:14:19 -08:00
transaction_test.cc Add bounds checking to WBWIIteratorImpl and respect bounds of ReadOptions in Transaction (#11680) 2023-10-20 13:28:28 -07:00
transaction_test.h Add Transaction::CollapseKey to collapse merge op chains ondemand (#11815) 2023-09-15 10:25:57 -07:00
transaction_util.cc Remove RocksDB LITE (#11147) 2023-01-27 13:14:19 -08:00
transaction_util.h Remove RocksDB LITE (#11147) 2023-01-27 13:14:19 -08:00
write_committed_transaction_ts_test.cc Surface timestamp from db to the transaction iterator (#11847) 2023-09-22 17:28:36 -07:00
write_prepared_transaction_test.cc Add missing status check when compiling with `ASSERT_STATUS_CHECKED=1` (#11686) 2023-08-09 15:46:44 -07:00
write_prepared_txn.cc Add bounds checking to WBWIIteratorImpl and respect bounds of ReadOptions in Transaction (#11680) 2023-10-20 13:28:28 -07:00
write_prepared_txn.h Group rocksdb.sst.read.micros stat by different user read IOActivity + misc (#11444) 2023-08-08 17:26:50 -07:00
write_prepared_txn_db.cc Track full_history_ts_low per SuperVersion (#11784) 2023-09-13 16:34:18 -07:00
write_prepared_txn_db.h Group rocksdb.sst.read.micros stat by different user read IOActivity + misc (#11444) 2023-08-08 17:26:50 -07:00
write_unprepared_transaction_test.cc Refactor WriteUnpreparedStressTest to be a unit test (#11424) 2023-05-22 12:31:52 -07:00
write_unprepared_txn.cc Add bounds checking to WBWIIteratorImpl and respect bounds of ReadOptions in Transaction (#11680) 2023-10-20 13:28:28 -07:00
write_unprepared_txn.h Group rocksdb.sst.read.micros stat by different user read IOActivity + misc (#11444) 2023-08-08 17:26:50 -07:00
write_unprepared_txn_db.cc Track full_history_ts_low per SuperVersion (#11784) 2023-09-13 16:34:18 -07:00
write_unprepared_txn_db.h Group rocksdb.sst.read.micros stat by different user read IOActivity + misc (#11444) 2023-08-08 17:26:50 -07:00