Skip to content

Comments

client: support versioned coprocessor routing#1871

Merged
ti-chi-bot[bot] merged 4 commits intotikv:feature/ftsfrom
wshwsh12:lookup-fts-branch
Feb 13, 2026
Merged

client: support versioned coprocessor routing#1871
ti-chi-bot[bot] merged 4 commits intotikv:feature/ftsfrom
wshwsh12:lookup-fts-branch

Conversation

@wshwsh12
Copy link
Contributor

@wshwsh12 wshwsh12 commented Feb 5, 2026

  • route version-aware cop to VersionedKv
  • add versioned cop cmd types in tikvrpc

@ti-chi-bot ti-chi-bot bot added the dco-signoff: yes Indicates the PR's author has signed the dco. label Feb 5, 2026
@coderabbitai
Copy link

coderabbitai bot commented Feb 5, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@ti-chi-bot ti-chi-bot bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Feb 5, 2026
@ti-chi-bot ti-chi-bot bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Feb 5, 2026
- route version-aware cop to VersionedKv
- add versioned cop cmd types in tikvrpc
- bump kvproto to f3cc97745222

Signed-off-by: wshwsh12 <793703860@qq.com>
@ti-chi-bot ti-chi-bot bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Feb 10, 2026
return "CopStream"
case CmdBatchCop:
return "BatchCop"
case CmdVersionedCop:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest putting CmdVersionedCop right after CmdCop wherever it appears to keep consistency, except CmdVersionedCop is at the end of the CmdType enum.

@ChangRui-Ryan
Copy link

lgtm

Signed-off-by: wshwsh12 <793703860@qq.com>
@cfzjywxk cfzjywxk requested review from you06 and zyguan February 12, 2026 06:42
}

// Version-aware coprocessor requests should go through VersionedKv services.
if req.Type == tikvrpc.CmdVersionedCop {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BatchReq would be used by default at L354, I suppose this may not be reached, have you executed E2E test for this PR?

Copy link
Contributor Author

@wshwsh12 wshwsh12 Feb 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.”

@wshwsh12 wshwsh12 requested a review from cfzjywxk February 12, 2026 07:19
@you06
Copy link
Contributor

you06 commented Feb 12, 2026

isReadReq needs to be updated.

func isReadReq(tp tikvrpc.CmdType) bool {
switch tp {
case tikvrpc.CmdGet, tikvrpc.CmdBatchGet, tikvrpc.CmdScan,
tikvrpc.CmdCop, tikvrpc.CmdBatchCop, tikvrpc.CmdCopStream:
return true
default:
return false
}
}

Signed-off-by: wshwsh12 <793703860@qq.com>
Copy link
Contributor

@zyguan zyguan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we handle CmdVersionedCop in codec v2 ?

@wshwsh12
Copy link
Contributor Author

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.

@wshwsh12 wshwsh12 requested a review from zyguan February 12, 2026 14:24
@zyguan
Copy link
Contributor

zyguan commented Feb 13, 2026

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>
@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Feb 13, 2026
@ti-chi-bot ti-chi-bot bot added the approved label Feb 13, 2026
@ti-chi-bot ti-chi-bot bot added the lgtm label Feb 13, 2026
@ti-chi-bot
Copy link

ti-chi-bot bot commented Feb 13, 2026

[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

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot removed the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Feb 13, 2026
@ti-chi-bot
Copy link

ti-chi-bot bot commented Feb 13, 2026

[LGTM Timeline notifier]

Timeline:

  • 2026-02-13 02:31:25.668810651 +0000 UTC m=+158438.748801356: ☑️ agreed by zyguan.
  • 2026-02-13 07:25:20.344725056 +0000 UTC m=+176073.424715761: ☑️ agreed by you06.

@ti-chi-bot ti-chi-bot bot merged commit b9470bb into tikv:feature/fts Feb 13, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved dco-signoff: yes Indicates the PR's author has signed the dco. lgtm size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants