rocksdb/utilities/write_batch_with_index
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
..
write_batch_with_index.cc Add bounds checking to WBWIIteratorImpl and respect bounds of ReadOptions in Transaction (#11680) 2023-10-20 13:28:28 -07:00
write_batch_with_index_internal.cc Add bounds checking to WBWIIteratorImpl and respect bounds of ReadOptions in Transaction (#11680) 2023-10-20 13:28:28 -07:00
write_batch_with_index_internal.h Add bounds checking to WBWIIteratorImpl and respect bounds of ReadOptions in Transaction (#11680) 2023-10-20 13:28:28 -07:00
write_batch_with_index_test.cc Add bounds checking to WBWIIteratorImpl and respect bounds of ReadOptions in Transaction (#11680) 2023-10-20 13:28:28 -07:00