-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
kvserver: proxy requests that return a NotLeaseholderError
Previously if a request that required a direct connection to a leaseholder would fail if the client was unable to initiate this connection. This PR adds the client and server sides of proxy handling to work around partial partitions. 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 the transport has moved to the next replica, then it will add the ProxyRangeInfo header to the request and send it to each 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 only send the request to the leaseholder based on the ProxyRangeInfo header. 3) On the server side of the node, it will normally evaulate a request even if ProxyRangeInfo is set. If 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. It will return the end users response rather than its local response. The impact of this change is to allow a BatchRequest 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: #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.
- Loading branch information
1 parent
a9c3a59
commit 0fe4c02
Showing
4 changed files
with
216 additions
and
27 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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