Skip to content

*: update kvproto and adapt keyspace fields - #69942

Merged
ti-chi-bot[bot] merged 33 commits into
masterfrom
apiv3-update-proto
Aug 14, 2026
Merged

ti-chi-bot[bot] merged 33 commits 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 selected kvproto revision changes several 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 059694ae4472276644613acccefa24cbc89d959f.
  • Update client-go and PD client to compatible revisions.
  • Keep the existing numeric keyspace-ID behavior by adapting AutoID, external workload, keyspace metadata, mockstore/unistore, executor, BR, and test code to oneof getters and wrappers.
  • Regenerate Bazel dependency metadata.

This PR intentionally does not implement API V3 keyspace identity semantics.

Check List

Tests

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

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

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

Release note

None

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
@coderabbitai

coderabbitai Bot commented Jul 20, 2026 •

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

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

Changes

Keyspace protobuf migration

Layer / File(s) Summary
Dependency pin updates
DEPS.bzl, go.mod, pkg/*/BUILD.bazel
Updates dependency versions, integrity metadata, Bazel dependencies, and test shard counts.
Auto-ID keyspace identity flow
pkg/autoid_service/..., pkg/meta/autoid/...
Validates keyspace identities and sends identity- or ID-based AutoID and Rebase requests.
External workload identity headers
pkg/extworkload/client/..., pkg/extworkload/manager.go
Adds optional keyspace identity headers and tests V3 header fields.
Production protobuf API alignment
pkg/executor/..., pkg/store/mockstore/..., pkg/store/mockstore/unistore/...
Uses protobuf getters and oneof metadata. Adds mock keyspace identity methods.
Test fixture migration
br/..., pkg/ddl/..., pkg/domain/..., pkg/dxf/..., pkg/executor/..., pkg/session/..., pkg/store/..., pkg/tablecodec/...
Updates keyspace metadata and request fixtures to the APIV3 protobuf representation.
Leak-check test support
br/cmd/br/main_test.go
Adds the memory arbitrator goroutine to the leak-check ignore list.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

Suggested reviewers: amoebaprotozoa, lcwangchao

Poem

A rabbit checks each oneof field,
New keyspace shapes are revealed.
Identity hops through every call,
Getter paths replace fields tall.
Fresh pins make the build stand tall.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% 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 The changes update APIV3 dependencies and adapt the affected AutoID, keyspace, mockstore, BR, executor, and test code.
Out of Scope Changes check ✅ Passed The reviewed changes support APIV3 dependency compatibility and related generated API migrations.
Title check ✅ Passed The title clearly summarizes the dependency update and the required keyspace field adaptations.
Description check ✅ Passed The description includes the issue, problem context, implementation summary, tests, side effects, documentation status, and release note.
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🛠️ Fix failing CI checks 💡
  • 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 11.53846% with 23 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.9817%. Comparing base (46e9228) to head (2fd5519).

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #69942        +/-   ##
================================================
- Coverage   76.3264%   74.9817%   -1.3447%     
================================================
  Files          2041       2111        +70     
  Lines        558217     588959     +30742     
================================================
+ Hits         426067     441612     +15545     
- Misses       131250     144923     +13673     
- Partials        900       2424      +1524     
Flag Coverage Δ
integration 45.6598% <11.5384%> (+5.9911%) ⬆️

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

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

Signed-off-by: disksing <i@disksing.com>
@ti-chi-bot ti-chi-bot Bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jul 22, 2026
ti-chi-bot and others added 3 commits July 22, 2026 15:18
Signed-off-by: disksing <i@disksing.com>
Signed-off-by: disksing <i@disksing.com>
@disksing

Copy link
Copy Markdown
Contributor Author

/test pull-br-integration-test

1 similar comment
@disksing

Copy link
Copy Markdown
Contributor Author

/test pull-br-integration-test

@disksing

Copy link
Copy Markdown
Contributor Author

/test pull-integration-e2e-test

@disksing

Copy link
Copy Markdown
Contributor Author

/test pull-mysql-client-test

@disksing

Copy link
Copy Markdown
Contributor Author

/test pull-br-integration-test

…pdate-proto

Signed-off-by: disksing <i@disksing.com>

# Conflicts:
#	DEPS.bzl
#	go.mod
#	go.sum
#	pkg/meta/autoid/BUILD.bazel
#	pkg/meta/autoid/autoid_service.go
…pdate-proto

Signed-off-by: disksing <i@disksing.com>
@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

Signed-off-by: disksing <i@disksing.com>
Signed-off-by: disksing <i@disksing.com>
@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 Aug 13, 2026
@disksing disksing changed the title *: update kvproto to apiv3 *: update kvproto and adapt keyspace fields Aug 13, 2026
@disksing

Copy link
Copy Markdown
Contributor Author

Scope update: this PR now only updates the dependencies and adapts TiDB to the generated protobuf oneofs while preserving the existing numeric keyspace-ID behavior. API V3 KeyspaceIdentity propagation/validation and the related tests have been removed in 47f07c8. This also makes the earlier non-blocking V3 server-validation test suggestion no longer applicable. @bb7133, please take another look when convenient; I have left the /hold in place.

Signed-off-by: disksing <i@disksing.com>
Signed-off-by: disksing <i@disksing.com>
Signed-off-by: disksing <i@disksing.com>
@disksing

Copy link
Copy Markdown
Contributor Author

/retest-required

@YangKeao

Copy link
Copy Markdown
Member

#70343 is blocked by this because that one also needs to update client-go, which already depends on kv proto v3.

Signed-off-by: disksing <i@disksing.com>
Signed-off-by: disksing <i@disksing.com>
@disksing

Copy link
Copy Markdown
Contributor Author

/test unit-test

Signed-off-by: disksing <i@disksing.com>
…pdate-proto

Signed-off-by: disksing <i@disksing.com>
@disksing

Copy link
Copy Markdown
Contributor Author

/test unit-test

…pdate-proto

Signed-off-by: disksing <i@disksing.com>
Signed-off-by: disksing <i@disksing.com>
@disksing

Copy link
Copy Markdown
Contributor Author

/test pull-br-integration-test

@bb7133 bb7133 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@ti-chi-bot

ti-chi-bot Bot commented Aug 14, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: 3pointer, bb7133, GMHDBJD, lcwangchao

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 added the approved label Aug 14, 2026
@bb7133

bb7133 commented Aug 14, 2026

Copy link
Copy Markdown
Member

/unhold

@ti-chi-bot ti-chi-bot Bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 14, 2026
@ti-chi-bot
ti-chi-bot Bot merged commit 17c0dd0 into master Aug 14, 2026
41 checks passed
@ti-chi-bot
ti-chi-bot Bot deleted the apiv3-update-proto branch August 14, 2026 13:06
@YangKeao YangKeao mentioned this pull request Aug 24, 2026
2 of 13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved lgtm release-note-none Denotes a PR that doesn't merit a release note. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update kvproto dependency to APIV3 definitions

7 participants