Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

storage: implement RangeKeyChanged() for MVCCIncrementalIterator #86259

Merged

Commits on Aug 20, 2022

  1. storage: use RangeKeyChanged() in MVCCIncrementalIterator

    This patch uses `RangeKeyChanged()` to detect changes to range keys in
    `MVCCIncrementalIterator`. There are no functional changes.
    
    Some quick benchmarks, using catchup scans:
    
    ```
    name                                                                 old time/op  new time/op  delta
    CatchUpScan/mixed-case/withDiff=true/perc=0.00/numRangeKeys=0-24      538ms ± 1%   535ms ± 1%     ~     (p=0.211 n=10+9)
    CatchUpScan/mixed-case/withDiff=true/perc=0.00/numRangeKeys=1-24      690ms ± 0%   590ms ± 1%  -14.56%  (p=0.000 n=9+10)
    CatchUpScan/mixed-case/withDiff=true/perc=0.00/numRangeKeys=100-24    743ms ± 1%   646ms ± 1%  -13.13%  (p=0.000 n=9+9)
    CatchUpScan/mixed-case/withDiff=false/perc=0.00/numRangeKeys=0-24     794ms ± 1%   794ms ± 0%     ~     (p=0.579 n=10+10)
    CatchUpScan/mixed-case/withDiff=false/perc=0.00/numRangeKeys=1-24     966ms ± 0%   911ms ± 1%   -5.72%  (p=0.000 n=10+10)
    CatchUpScan/mixed-case/withDiff=false/perc=0.00/numRangeKeys=100-24   974ms ± 0%   920ms ± 0%   -5.51%  (p=0.000 n=10+10)
    ```
    
    Release justification: bug fixes and low-risk updates to new functionality.
    
    Release note: None
    erikgrinaker committed Aug 20, 2022
    Configuration menu
    Copy the full SHA
    44cb473 View commit details
    Browse the repository at this point in the history
  2. storage: implement RangeKeyChanged() for MVCCIncrementalIterator

    This patch implements `RangeKeyChanged()` for `MVCCIncrementalIterator`.
    It only fires if the time bound range keys change, not if a
    `Next(Key)IgnoringTime()` operation reveals additional range keys.
    
    Release justification: bug fixes and low-risk updates to new functionality
    
    Release note: None
    erikgrinaker committed Aug 20, 2022
    Configuration menu
    Copy the full SHA
    290926e View commit details
    Browse the repository at this point in the history
  3. storage: add MVCCIncrementalIterator.RangeKeysIgnoringTime()

    This patch changes `MVCCIncrementalIterator` range key behavior
    following a `Next(Key)IgnoringTime()` call. Previously, range key
    methods would then expose unfiltered range keys. Now, the standard range
    key methods only apply to filtered range keys. The additional
    `RangeKeysIgnoringTime()` and `RangeKeyChangedIgnoringTime()` methods
    provide access to unfiltered range keys.
    
    This implies that if such a call steps onto a range key that's entirely
    outside of the time bounds then:
    
    * `HasPointAndRange()` will return `false`,`false` if on a bare range
      key.
    
    * `RangeKeyChanged()` will not fire, unless stepping off of a range key
      within the time bounds.
    
    * `RangeBounds()` and `RangeKeys()` will return empty results.
    
    This is done to avoid conditional range key handling following these
    calls, except for the exact sites where the caller is interested in
    the unfiltered range keys.
    
    Release justification: bug fixes and low-risk updates to new functionality
    
    Release note: None
    erikgrinaker committed Aug 20, 2022
    Configuration menu
    Copy the full SHA
    1b064b4 View commit details
    Browse the repository at this point in the history