-
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
kvserver: only return range info when ClientRangeInfo
set
#102478
kvserver: only return range info when ClientRangeInfo
set
#102478
Conversation
See prior discussion in #100432. Going to let this sit for a little while to get the previous PR some baking time before the backport. |
8d4a2fb
to
8b503dc
Compare
#100432 has been baking for a couple of weeks now and the backport will merge shortly, so I think we can review this now @arulajmani. |
I'll let Arul review/approve this one. |
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.
Thanks for coming back and cleaning this up!
Reviewed 6 of 6 files at r1, all commit messages.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @erikgrinaker)
pkg/kv/kvserver/replica_send.go
line 322 at r1 (raw file):
} } else if ba.IsSingleRequestLeaseRequest() { // Remove this branch when 23.1 support is dropped.
nit: want to adopt the TODO for this?
8b503dc
to
bd11529
Compare
Previously, passing an empty `ClientRangeInfo` would always generate and return range info, because the zero values are always considered stale. An exception was made for lease requests, since these bypass DistSender and never use `ClientRangeInfo`. This patch instead only returns range info when a non-empty `ClientRangeInfo` is passed, with a version gate for 23.1 compatibility. Epic: none Release note: None
bd11529
to
15e23d3
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.
TFTR! There was a subtle bug here: LeaseSpeculative()
would return false
if the token did not have a lease. This meant that we wouldn't request cache info when we had a range descriptor with generation and no lease. Updated the code to be obviously correct by checking the exact values we're putting into the struct.
Reviewable status: complete! 0 of 0 LGTMs obtained (and 1 stale) (waiting on @arulajmani)
pkg/kv/kvserver/replica_send.go
line 322 at r1 (raw file):
Previously, arulajmani (Arul Ajmani) wrote…
nit: want to adopt the TODO for this?
Done.
bors r+ |
Build failed (retrying...): |
Build succeeded: |
Previously, passing an empty
ClientRangeInfo
would always generate and return range info, because the zero values are always considered stale. An exception was made for lease requests, since these bypass DistSender and never useClientRangeInfo
.This patch instead only returns range info when a non-empty
ClientRangeInfo
is passed, with a version gate for 23.1 compatibility.Epic: none
Release note: None