-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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: use RangeKeyChanged()
in MVCCClearTimeRange
#86527
storage: use RangeKeyChanged()
in MVCCClearTimeRange
#86527
Conversation
d4bca65
to
cb09df3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 4 of 5 files at r3, 1 of 1 files at r4, all commit messages.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @erikgrinaker)
-- commits
line 70 at r4:
Also seems like low-reward, should we let this sit then?
pkg/storage/mvcc.go
line 2697 at r4 (raw file):
!clearedMeta.Timestamp.ToTimestamp().LessEq(v.Timestamp) { rangeKeys := iter.RangeKeysIgnoringTime() if rangeKeys.IsEmpty() || !rangeKeys.HasBetween(k.Timestamp, v.Timestamp.Prev()) {
This is just making the previous behavior more explicit, right? Since IsEmpty() => !HasBetween
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @tbg)
Previously, tbg (Tobias Grieger) wrote…
Also seems like low-reward, should we let this sit then?
I'd rather get everything ported to RangeKeyChanged()
, so that's the canonical way to handle this. Also, this should have a decent boost when there are MVCC range tombstones present, since it avoids both a key comparison and binary search in the hot path.
pkg/storage/mvcc.go
line 2697 at r4 (raw file):
Previously, tbg (Tobias Grieger) wrote…
This is just making the previous behavior more explicit, right? Since
IsEmpty() => !HasBetween
.
It's really a performance optimization, since HasBetween
calls through to sort.Search
, which was found to be really expensive over in #86515. Even though that PR now checks the empty case internally, omitting the function call entirely was found to have a non-negligible perf benefit in very hot paths like ComputeStats
so may as well check it here too.
Some minor optimizations that might yield minor performance improvements. We don't have any benchmarks for this function, and it's used fairly rarely. Release justification: bug fixes and low-risk updates to new functionality Release note: None
cb09df3
to
6a37ef3
Compare
bors r=tbg |
Build failed (retrying...): |
Build failed (retrying...): |
Build failed (retrying...): |
Build succeeded: |
Some minor optimizations that might yield minor performance
improvements. We don't have any benchmarks for this function, and it's
used fairly rarely.
Release justification: bug fixes and low-risk updates to new functionality
Release note: None