client: support versioned coprocessor routing#1871
client: support versioned coprocessor routing#1871ti-chi-bot[bot] merged 4 commits intotikv:feature/ftsfrom
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
eccf1fc to
ecdf77a
Compare
- route version-aware cop to VersionedKv - add versioned cop cmd types in tikvrpc - bump kvproto to f3cc97745222 Signed-off-by: wshwsh12 <793703860@qq.com>
ecdf77a to
307ce45
Compare
| return "CopStream" | ||
| case CmdBatchCop: | ||
| return "BatchCop" | ||
| case CmdVersionedCop: |
There was a problem hiding this comment.
Suggest putting CmdVersionedCop right after CmdCop wherever it appears to keep consistency, except CmdVersionedCop is at the end of the CmdType enum.
|
lgtm |
4a3be82 to
8dbf9ae
Compare
| } | ||
|
|
||
| // Version-aware coprocessor requests should go through VersionedKv services. | ||
| if req.Type == tikvrpc.CmdVersionedCop { |
There was a problem hiding this comment.
BatchReq would be used by default at L354, I suppose this may not be reached, have you executed E2E test for this PR?
There was a problem hiding this comment.
"ToBatchCommandsRequest" can't converts CmdVersionedCop to BatchReq and return nil. So now CmdVersionedCop always reached this path.
And I have run some sqls in my local and it works.
There was a problem hiding this comment.
Here are some performance risks. How often is this CmdVersionedCop called? If the frequency is high, I think it's necessary to modify kvproto to include it in the BatchReq and BatchResp.
There was a problem hiding this comment.
Currently, this feature does not have high performance requirements, and RPC requests are not the performance bottleneck. We can optimize it later if performance becomes an issue.”
|
client-go/internal/locate/replica_selector.go Lines 605 to 613 in 6e80a22 |
zyguan
left a comment
There was a problem hiding this comment.
Should we handle CmdVersionedCop in codec v2 ?
My understanding is that only keyspace requires codec v2. Currently, VersionedCop has not been implemented for keyspace. When I need to implement VersionedCop for keyspace, I will add the corresponding support in client-go. |
So, how about to add the following code to codec v2? case tikvrpc.CmdVersionedCop:
// TODO: ...
return nil, errors.New("...") |
Signed-off-by: wshwsh12 <793703860@qq.com>
611b368 to
5638531
Compare
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: you06, zyguan The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Uh oh!
There was an error while loading. Please reload this page.