-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
store/tikv: forward requests by BatchCommands #23243
store/tikv: forward requests by BatchCommands #23243
Conversation
Signed-off-by: youjiali1995 <zlwgx1023@gmail.com>
ee58a24
to
d00ce77
Compare
af07828
to
b1bb6af
Compare
Signed-off-by: youjiali1995 <zlwgx1023@gmail.com>
b1bb6af
to
e56fed4
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.
If "forwardedHost" is set, the request is sent to that host, instead of the node specified by the "addr"?
So why not simply modify the SendRequest
function:
func (c *RPCClient) SendRequest(ctx context.Context, addr string, req *tikvrpc.Request, timeout time.Duration) (*tikvrpc.Response, error) {
if req.ForwardedHost != nil {
return originalSendRequest(ctx, req.ForwardedHost, ...)
}
originalSendRequest(ctx, addr, ...)
}
Add forwardedClients map[string]*batchCommandsStream
to batchCommandsClient
to gain the ability to send requests to other(any) nodes looks weird.
No. The request is sent to the node with the address at "addr". If "forwardedHost" is set, the request will be forwarded to the "forwardedHost" by the node as a proxy, i.e. TiDB -> TiKV(addr) -> TiKV(forwardedHost) @tiancaiamao BTW, I will split this PR into 2. One is to forward requests by unary-calls and the second is to forward requests by BatchCommands. The second one lacks tests and I will add it today. |
Signed-off-by: youjiali1995 <zlwgx1023@gmail.com>
Signed-off-by: youjiali1995 <zlwgx1023@gmail.com>
…-redirection-metadata Signed-off-by: youjiali1995 <zlwgx1023@gmail.com>
/run-all-tests |
/run-unit-test |
…-redirection-metadata Signed-off-by: youjiali1995 <zlwgx1023@gmail.com>
…-redirection-metadata
/run-all-tests |
Signed-off-by: youjiali1995 <zlwgx1023@gmail.com>
…-redirection-metadata
/run-all-tests |
Signed-off-by: youjiali1995 <zlwgx1023@gmail.com>
/run-all-tests |
/LGTM I have to point out that the complexity of supporting the batch mode maybe not worth its value. |
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.
LGTM
@MyonKeminta: Please use If you have approved this PR, please ignore this reply. This reply is being used as a temporary reply during the migration of the new bot and will be removed on April 1. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by writing |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 94ace66
|
/run-unit-test |
|
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
cherry pick to release-5.0 in PR #23420 |
/run-cherry-picker |
Signed-off-by: youjiali1995 zlwgx1023@gmail.com
What problem does this PR solve?
Problem Summary:
Support forwarding requests by
BatchCommands
. Based on #23362.What is changed and how it works?
What's Changed:
Create a
BatchCommands
for each forwarded host in a single connection.How it Works:
Related changes
Check List
Tests
Release note