-
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: use messages on NotLeaseholderErrors everywhere #56334
Conversation
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 4 files at r1.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @andreimatei)
pkg/kv/kvserver/replica_application_result.go, line 217 at r1 (raw file):
r.store.StoreID(), r.mu.state.Desc, "request's timestamp below closed timestamp",
Aren't we setting this two lines down? Maybe just move that message (which is a little better) in here?
pkg/kv/kvserver/replica_range_lease.go, line 1101 at r1 (raw file):
log.VErrEventf(ctx, 2, "lease acquisition failed: %s", ctx.Err()) return roachpb.NewError(newNotLeaseHolderError(nil, r.store.StoreID(), r.Desc(), "lease acquisition canceled"))
maybe add "because context canceled" to differentiate with next message.
pkg/kv/kvserver/replica_range_lease.go, line 1105 at r1 (raw file):
llHandle.Cancel() return roachpb.NewError(newNotLeaseHolderError(nil, r.store.StoreID(), r.Desc(), "lease acquisition cancled because node is stopping"))
canceled
NLHE permits custom messages in it, but the field was rarely used. This patch makes every instance where we instantiate the error provide a message, since this error comes from a wide variety of conditions. Release note: None
af6a81f
to
3db3781
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.
Reviewable status: complete! 1 of 0 LGTMs obtained
pkg/kv/kvserver/replica_application_result.go, line 217 at r1 (raw file):
Previously, nvanbenschoten (Nathan VanBenschoten) wrote…
Aren't we setting this two lines down? Maybe just move that message (which is a little better) in here?
done
pkg/kv/kvserver/replica_range_lease.go, line 1101 at r1 (raw file):
Previously, nvanbenschoten (Nathan VanBenschoten) wrote…
maybe add "because context canceled" to differentiate with next message.
done
pkg/kv/kvserver/replica_range_lease.go, line 1105 at r1 (raw file):
Previously, nvanbenschoten (Nathan VanBenschoten) wrote…
canceled
done
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.
bors r+
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @nvanbenschoten)
This PR was included in a batch that was canceled, it will be automatically retried |
Build succeeded: |
NLHE permits custom messages in it, but the field was rarely used. This
patch makes every instance where we instantiate the error provide a
message, since this error comes from a wide variety of conditions.
Release note: None