-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
45163: storage,libroach: update MVCCIncrementalIterator to look at every updated key r=pbardea a=pbardea This latest implementation of MVCCIncrementalIterator updates its use of the time-bound iterator to only be used to skip over keys that were not modified at all within the time bound limits. Previously, the incremental iterator primarily used the time-bound iterator and then used a non-time-bound iterator (sanity_iter) to check that meta keys were properly read. See #43799 for discussion around why this may not be sufficient. This commit updates the implementation to use the time-bound iterator more conservatively. The 2 iterators that it now uses are `iter` (a non-time-bound iterator and `timeBoundIter`). The main iteration is now done with `iter`. When `iter` sees a new key, the `timeBoundIter` is incremented and if it goes further than `iter`, `iter` is `Seek`ed forward to the meta key of the new key. This means that `iter` should visit every version of every key that `timeBoundIter` visits. It should be noted that if many adjacent keys were modified, the above logic tries to avoid to do a `Seek` to the next key as a `Seek` is ~an order of magnitude more expensive than a `Next`. In cases where a lot of keys were modified, we expect to do ~double the work since 2 iterators would need to seek to every key. However, the expected use case for the MVCCIncrementalIterator is such that the _vast_ majority of the data is excluded from the range (as should be the case for incremental backups), since there is potentially years worth of data that can be skipped over, versus hours worth of data to include. Release note: None Co-authored-by: Paul Bardea <pbardea@gmail.com>
- Loading branch information
Showing
5 changed files
with
757 additions
and
162 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.