-
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
kv: Return descriptor hint in RangeKeyMismatchError #5911
kv: Return descriptor hint in RangeKeyMismatchError #5911
Conversation
@bdarnell is best qualified to comment on my suggestion about the replica creation timestamp. The reason I brought it up was because I was worried that an old range may not be GCed for a while and, repeatedly being returned with this new code here, could confuse DistSender (which at the moment takes hints pretty seriously). Though it's not clear to me whether it could repeatedly be returned ( Reviewed 10 of 10 files at r1. kv/dist_sender.go, line 667 [r1] (raw file): kv/dist_sender.go, line 670 [r1] (raw file): kv/dist_sender.go, line 731 [r1] (raw file): kv/dist_sender.go, line 750 [r1] (raw file): kv/dist_sender_test.go, line 660 [r1] (raw file): kv/range_cache.go, line 232 [r1] (raw file):
is a bit more correct (there's a storage/replica.go, line 791 [r1] (raw file): This is untested as far as I can tell? Comments from Reviewable |
Reviewed 10 of 10 files at r1. storage/replica.go, line 797 [r1] (raw file): Comments from Reviewable |
0a5bd49
to
9e1ef1a
Compare
Review status: 7 of 11 files reviewed at latest revision, 8 unresolved discussions, some commit checks failed. kv/dist_sender.go, line 667 [r1] (raw file): kv/dist_sender.go, line 670 [r1] (raw file): kv/dist_sender.go, line 731 [r1] (raw file): kv/dist_sender.go, line 750 [r1] (raw file): kv/dist_sender_test.go, line 660 [r1] (raw file): kv/range_cache.go, line 232 [r1] (raw file): storage/replica.go, line 791 [r1] (raw file): storage/replica.go, line 797 [r1] (raw file): Comments from Reviewable |
9e1ef1a
to
ecbc930
Compare
LGTM Reviewed 5 of 7 files at r2. kv/range_cache.go, line 232 [r2] (raw file): Comments from Reviewable |
Resolves cockroachdb#5880. This change makes `Replica` perform a best-effort lookup for the correct range in the case of `RangeKeyMismatchError` and provide this as a hint to `DistSender` for where to look next. The lookup is best-effort in that it will only be performed locally, and the suggestion will only be made if the current leader of the range is known.
ecbc930
to
0bbc628
Compare
Review status: 8 of 9 files reviewed at latest revision, 9 unresolved discussions. kv/range_cache.go, line 232 [r2] (raw file): Comments from Reviewable |
Resolves #5880.
This change makes
Replica
perform a best-effort lookup for the correctrange in the case of
RangeKeyMismatchError
and provide this as a hintto
DistSender
for where to look next.The change doesn't yet include a "replica creation timestamp" as I wasn't
convinced that was needed (but also wasn't convinced it wouldn't be a
nice indicator to have). I'm hoping to get some input on this.
This change is