Skip to content

coprocessor: add bucket version to store batch task#1488

Open
ekexium wants to merge 1 commit into
pingcap:release-nextgen-20251011from
ekexium:codex/cherry-pick-1478-to-release-nextgen-20251011
Open

coprocessor: add bucket version to store batch task#1488
ekexium wants to merge 1 commit into
pingcap:release-nextgen-20251011from
ekexium:codex/cherry-pick-1478-to-release-nextgen-20251011

Conversation

@ekexium

@ekexium ekexium commented Jun 10, 2026

Copy link
Copy Markdown
Member

Cherry-pick of #1478 to release-nextgen-20251011.

What is changed

Add buckets_version to coprocessor.StoreBatchTask so store-batched coprocessor requests can carry the bucket metadata version for each child task.

Why

Store-batched cop requests group child tasks by store, but the child tasks can belong to different regions. A single parent request context bucket version is not enough for downstream validation; TiDB/CSE need a per-child bucket version to avoid validating a child region with the parent task bucket version.

This is the wire-format prerequisite for fixing pingcap/tidb#68715.

Compatibility

This adds a new proto3 uint64 field with a new tag. Older clients and servers ignore the unknown field, and newer clients get the default value 0 when talking to older senders. Downstream code should treat 0 as unset and fall back to the existing parent request context behavior.

Checks

  • make go
  • go build ./pkg/...

Signed-off-by: Ziqian Qin <eke@fastmail.com>
(cherry picked from commit 46e67d1)
Signed-off-by: Ziqian Qin <eke@fastmail.com>
Copilot AI review requested due to automatic review settings June 10, 2026 04:37
@ti-chi-bot ti-chi-bot Bot requested review from pingyu and shihongzhi June 10, 2026 04:37
@ti-chi-bot ti-chi-bot Bot added the size/L label Jun 10, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Cherry-picks upstream kvproto change to extend the coprocessor StoreBatchTask protobuf with a buckets_version field (id=7), keeping the release branch in sync while updating generated artifacts.

Changes:

  • Add StoreBatchTask.buckets_version (uint64, field number 7) to proto/coprocessor.proto.
  • Regenerate Go protobuf output for the new field (struct field, getter, marshal/size/unmarshal, descriptor bytes).
  • Update scripts/proto.lock to reflect the new protobuf field metadata.

Reviewed changes

Copilot reviewed 1 out of 3 changed files in this pull request and generated no comments.

File Description
scripts/proto.lock Records the newly added buckets_version field (id=7) in the locked proto schema metadata.
proto/coprocessor.proto Adds buckets_version to StoreBatchTask for bucket-metadata version validation.
pkg/coprocessor/coprocessor.pb.go Regenerated Go protobuf code to include BucketsVersion field support (getter + (un)marshal/size updates).
Files not reviewed (1)
  • pkg/coprocessor/coprocessor.pb.go: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ekexium ekexium requested a review from cfzjywxk June 10, 2026 04:40
@ti-chi-bot

ti-chi-bot Bot commented Jun 18, 2026

Copy link
Copy Markdown

@wfxr: adding LGTM is restricted to approvers and reviewers in OWNERS files.

Details

In response to this:

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 kubernetes-sigs/prow repository.

@ti-chi-bot

ti-chi-bot Bot commented Jun 18, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: wfxr
Once this PR has been reviewed and has the lgtm label, please assign cfzjywxk for approval. For more information see the Code Review Process.
Please ensure that each of them provides their approval before proceeding.

The full list of commands accepted by this bot can be found 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants