Skip to content

feat(kvrpcpb): add lock upgrade conflict error#1495

Draft
wfxr wants to merge 1 commit into
pingcap:masterfrom
wfxr:feat/shared-lock-upgrade-next-gen
Draft

feat(kvrpcpb): add lock upgrade conflict error#1495
wfxr wants to merge 1 commit into
pingcap:masterfrom
wfxr:feat/shared-lock-upgrade-next-gen

Conversation

@wfxr

@wfxr wfxr commented Jul 1, 2026

Copy link
Copy Markdown
Member

What problem does this PR solve?

Cloud Storage Engine needs to return typed errors when a shared-lock upgrade request conflicts with an existing in-flight upgrader. Today the protocol has no dedicated KeyError variant for this case, so CSE cannot distinguish duplicate in-flight upgrade attempts from second-upgrader conflicts at the API boundary.

Related CSE work:

  • tidbcloud/cloud-storage-engine#5476
  • tidbcloud/cloud-storage-engine#5477

Related TiDB work:

What is changed and how it works?

  • Add LockUpgradeConflict to kvrpcpb.KeyError.
  • Add LockUpgradeConflict.Reason with:
    • DuplicateInFlight
    • SecondUpgrader
  • Regenerate Go protobuf output for kvrpcpb.
  • Update scripts/proto.lock.

This is an additive protobuf change and preserves wire compatibility for existing clients.

Check List

  • Updated protobuf schema.
  • Regenerated checked-in Go protobuf output.
  • Updated scripts/proto.lock.
  • Verified Go generation and build with make go.
  • Verified Rust generation paths with make rust.

Add the typed LockUpgradeConflict message to kvrpcpb and expose it on KeyError as field 13. Regenerate the corresponding Go bindings and update proto.lock so downstream repos can depend on a stable machine-readable upgrade-conflict protocol shape.
@ti-chi-bot

ti-chi-bot Bot commented Jul 1, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
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

@ti-chi-bot ti-chi-bot Bot requested a review from 0xPoe July 1, 2026 02:53
@pingcap-cla-assistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant