Skip to content

*: update kvproto to apiv3#69942

Open
disksing wants to merge 1 commit into
masterfrom
apiv3-update-proto
Open

*: update kvproto to apiv3#69942
disksing wants to merge 1 commit into
masterfrom
apiv3-update-proto

Conversation

@disksing

@disksing disksing commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Issue Number: close #69944

Problem Summary:

The kvproto APIV3 branch changes keyspace and AutoID protobuf fields to oneofs. TiDB needs compatible kvproto, client-go, and PD client revisions together with source updates for the generated APIs.

What changed and how does it work?

  • Update kvproto to fd32127adca58438f6b05c869951182bbdd6041c.
  • Update client-go and PD client to APIV3-compatible revisions.
  • Adapt AutoID, keyspace metadata, mockstore/unistore, executor, BR, and test code to oneof getters and wrappers.
  • Regenerate Bazel dependency metadata.

Check List

Tests

  • Unit test
    • make bazel_prepare
    • make bazel_bin
    • make lint
    • go test -tags=intest ./pkg/autoid_service -run '^TestAPI$' -count=1
    • ./tools/check/failpoint-go-test.sh pkg/meta/autoid -run '^TestUnsignedAutoid$' -count=1
    • go test ./pkg/store/mockstore/unistore

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility: updates generated protobuf APIs to the APIV3 definitions

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

None

Summary by CodeRabbit

  • Dependency Updates

    • Updated TiKV, PD, and kvproto integrations to newer compatible versions.
    • Added support for required keyspace-related protocol data in mock storage components.
  • Bug Fixes

    • Improved keyspace ID handling across metadata, storage, auto-ID allocation, and query processing.
    • Added keyspace identity support to mock service discovery.
  • Tests

    • Updated keyspace-aware tests for the latest protocol representation and access patterns.

Signed-off-by: disksing <i@disksing.com>
@ti-chi-bot ti-chi-bot Bot added do-not-merge/needs-linked-issue do-not-merge/needs-tests-checked release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jul 20, 2026
@ti-chi-bot

ti-chi-bot Bot commented Jul 20, 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 3pointer, bb7133, gmhdbjd 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

@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

This change updates kvproto, TiKV, and PD dependency pins; migrates keyspace protobuf usage to oneof wrappers and getter accessors; adds mock keyspace identity methods; and updates affected production code and tests.

Changes

Keyspace protobuf migration

Layer / File(s) Summary
Dependency pin updates
DEPS.bzl, go.mod
Updates pinned kvproto, TiKV client, and PD client versions and integrity metadata.
Production API alignment
pkg/autoid_service/..., pkg/meta/autoid/..., pkg/executor/..., pkg/store/mockstore/..., pkg/store/mockstore/unistore/...
Uses protobuf accessors and wrapped keyspace fields, adds mock keyspace identity methods, and adds the required Bazel dependency.
Test fixture migration
br/..., pkg/autoid_service/..., pkg/ddl/..., pkg/domain/..., pkg/dxf/..., pkg/executor/..., pkg/extworkload/..., pkg/ingestor/..., pkg/server/..., pkg/session/..., pkg/store/..., pkg/tablecodec/..., pkg/testkit/...
Updates keyspace metadata and auto-ID request construction to the new protobuf oneof representation while preserving test behavior.
PD manager test alignment
pkg/store/mockstore/unistore/pd_test.go
Adds a keyspace metadata helper and changes keyspace manager assertions and fixtures to use protobuf getters.

Estimated code review effort: 2 (Simple) | ~15 minutes

Possibly related PRs

Suggested reviewers: d3hunter, yujuncen

Poem

I’m a rabbit with wrappers tucked neat,
Oneof carrots make protobufs complete.
Getter hops through mockstores bright,
Fresh pins keep the build just right.
Tests nibble the old fields away.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.59% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title is concise and accurately summarizes the main change: updating kvproto to APIV3.
Description check ✅ Passed The description matches the template and includes the issue, summary, tests, side effects, docs, and release note.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch apiv3-update-proto

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.

@codecov

codecov Bot commented Jul 20, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 13.04348% with 20 lines in your changes missing coverage. Please review.
✅ Project coverage is 75.5590%. Comparing base (a9e28f2) to head (3966c4d).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #69942        +/-   ##
================================================
- Coverage   76.3194%   75.5590%   -0.7604%     
================================================
  Files          2041       2086        +45     
  Lines        559924     582748     +22824     
================================================
+ Hits         427331     440319     +12988     
- Misses       131692     140285      +8593     
- Partials        901       2144      +1243     
Flag Coverage Δ
integration 45.6097% <13.0434%> (+5.9044%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
dumpling 60.4471% <ø> (ø)
parser ∅ <ø> (∅)
br 64.0213% <ø> (+1.3000%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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

Labels

release-note-none Denotes a PR that doesn't merit a release note. 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.

Update kvproto dependency to APIV3 definitions

1 participant