forked from cockroachdb/cockroach
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
117340: kvserver: proxy requests that return a NotLeaseholderError r=erikgrinaker a=andrewbaptist Previously if a request that required a direct connection to a leaseholder would fail if the client was unable to initiate this connection. There is a new field ProxyRangeInfo added to the BatchRequest header. This field is set by a client which wants to request the server will proxy the request for it. There are three main changes as part of this request. 1) In DistSender if the client needs to send a request to a Leaseholder but its transport has moved to the next replica, then it will add the ProxyRangeInfo header to the request and send it to the follower. 2) In DistSender if it is attempting to send a request that already has the ProxyRangeInfo header set, then it will short circuit much of the retry logic and instead only send the request to the leaseholder the original client wanted to send it to. 3) On the server side of the node, it will normally evaulate a request even if ProxyRangeInfo is set. If its local evaluation results in a NotLeaseHolderError and the range info matches what the client set in the ProxyRangeInfo header, it will attempt to proxy the request to the leaseholder and return the response from that request instead. The impact of this change is to allow Batch requests to succeed as long as there is connectivity between the client and at least one replica that has a direct connection to the leaseholder. Epic: none Fixes: cockroachdb#93503 Release note (ops change): This PR adds an additional setting kv.dist_sender.proxy.enabled which is defaulted to true. When it is enabled, proxy requests will be routed through a follower replica when the leaseholder is unavailable. Co-authored-by: Andrew Baptist <[email protected]>
- Loading branch information
Showing
10 changed files
with
357 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.