Add.read options.cache_sst_file_iter
rockeet opened this issue · 0 comments
This was a PR to upstream facebook/rocksdb#10593
Copied from facebook/rocksdb#10593
This PR resolves facebook/rocksdb#10591:
DB Iterator is an heavy object and it should be reused if possible, thus when DB Iterator is reused the underlying SST's should also be reused, we have add the SST Iter cache to LevelIterator.
Failed unit test are all passed
With env CACHE_SST_FILE_ITER set to 1, ReadOptions::cache_sst_file_iter will be set to true by default, thus all unit test can be reused.
There are still 2 unit test failed because SST File Iterator is cached, I just skip the corresponding ASSERT when cache_sst_file_iter is set to 1.
Now all related bugs was fixed
Relevant commits
d043644 cache_sst_file_iter: fix iter leak for cache_sst_file_iter = false
e86b8d7 cache_sst_file_iter: change relavent code being similar to upstream
e80fe1b cache_sst_file_iter: bugfix for pinned_iters_mgr_
96a20be LevelIterator: Add ReadOptions::cache_sst_file_iter