Skip to content

chore: upgrade tonic and prost to 0.14 - #552

Open
mingley wants to merge 4 commits into
tikv:masterfrom
mingley:mingley/tonic-0-14
Open

chore: upgrade tonic and prost to 0.14#552
mingley wants to merge 4 commits into
tikv:masterfrom
mingley:mingley/tonic-0-14

Conversation

@mingley

@mingley mingley commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Upgrade tonic to 0.14 and prost to 0.14.
  • Adopt the tonic-prost runtime/codegen split and select the ring TLS backend.
  • Regenerate protobuf clients and remove clones made redundant by prost 0.14 generated Copy types.

This advances the dependency alignment described in roadmap issue #506.

Testing Done

  • Local code review completed
  • make check
  • cargo test --workspace — 116 passed, 0 failed
  • cargo test --workspace --no-default-features — 116 passed, 0 failed
  • make doc — passed
  • PD_ADDRS=127.0.0.1:2379 MULTI_REGION=1 RUST_LOG=info NEXTEST_PROFILE=ci cargo nextest run --config-file config/nextest.toml --all --features integration-tests --test-threads 1 — 128 passed, 0 failed
  • PD_ADDRS=127.0.0.1:2379 MULTI_REGION=1 RUST_LOG=info NEXTEST_PROFILE=ci cargo nextest run --config-file config/nextest.toml --test failpoint_tests --features 'integration-tests fail/failpoints' --test-threads 1 — 6 passed, 0 failed

Summary by CodeRabbit

  • Improvements
    • Updated communication and protocol components for improved compatibility and maintainability.
    • Reduced unnecessary timestamp copying during transaction, lock-resolution, commit, rollback, scanning, and heartbeat operations.
    • Improved handling of uncertain regional outcomes and dispatch errors, including configurable terminal responses and more consistent retry behavior.
    • Preserved existing transaction behavior and public APIs.

Signed-off-by: Michael Ingley <michael.ingley@gmail.com>
@ti-chi-bot ti-chi-bot Bot added the dco-signoff: yes Indicates the PR's author has signed the dco. label Jul 21, 2026
@ti-chi-bot

ti-chi-bot Bot commented Jul 21, 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 innerr 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 added contribution This PR is from a community contributor. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Jul 21, 2026
@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Team

Run ID: c2979ccc-c560-4618-a6a6-878a6c71ad60

📥 Commits

Reviewing files that changed from the base of the PR and between db9551b and 29db2f8.

⛔ Files ignored due to path filters (21)
  • src/generated/backup.rs is excluded by !**/generated/**
  • src/generated/cdcpb.rs is excluded by !**/generated/**
  • src/generated/coprocessor.rs is excluded by !**/generated/**
  • src/generated/deadlock.rs is excluded by !**/generated/**
  • src/generated/encryptionpb.rs is excluded by !**/generated/**
  • src/generated/errorpb.rs is excluded by !**/generated/**
  • src/generated/import_sstpb.rs is excluded by !**/generated/**
  • src/generated/keyspacepb.rs is excluded by !**/generated/**
  • src/generated/kvrpcpb.rs is excluded by !**/generated/**
  • src/generated/logbackup.rs is excluded by !**/generated/**
  • src/generated/meta_storagepb.rs is excluded by !**/generated/**
  • src/generated/metapb.rs is excluded by !**/generated/**
  • src/generated/mpp.rs is excluded by !**/generated/**
  • src/generated/pdpb.rs is excluded by !**/generated/**
  • src/generated/raft_cmdpb.rs is excluded by !**/generated/**
  • src/generated/raft_serverpb.rs is excluded by !**/generated/**
  • src/generated/resource_manager.rs is excluded by !**/generated/**
  • src/generated/resource_usage_agent.rs is excluded by !**/generated/**
  • src/generated/schedulingpb.rs is excluded by !**/generated/**
  • src/generated/tikvpb.rs is excluded by !**/generated/**
  • src/generated/tsopb.rs is excluded by !**/generated/**
📒 Files selected for processing (3)
  • src/request/plan.rs
  • src/transaction/transaction.rs
  • src/transaction/transaction/scanner.rs

Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review.


📝 Walkthrough

Walkthrough

This PR updates the tonic/prost toolchain and protobuf generation, adds terminal handling for undetermined and dispatch errors, and removes unnecessary timestamp and region-epoch clones across transaction and lock-resolution paths.

Changes

gRPC, retry, and timestamp updates

Layer / File(s) Summary
Protobuf dependency and generation migration
Cargo.toml, proto-build/Cargo.toml, proto-build/src/main.rs
The tonic/prost dependencies and TLS features are upgraded. Protobuf generation switches to tonic-prost-build with PathBuf include paths.
Terminal multi-region retry handling
src/request/plan.rs
Undetermined results and dispatch-stage gRPC errors receive configurable terminal handling. Undetermined errors retain precedence over determinate shard errors. Tests cover classification, retries, terminal returns, cache invalidation, and error precedence.
Lock resolution and timestamp passing
src/request/plan.rs, src/transaction/client.rs, src/transaction/transaction.rs, src/transaction/transaction/scanner.rs
Lock resolution, transaction operations, scans, heartbeats, commits, and rollbacks pass timestamp values directly instead of cloning them. Shared-lock validation occurs before async-commit filtering.

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

Merge Risk: ⚪ Minimal · up to 29db2

The dependency and generated-client updates pass the listed checks and tests, and no actionable merge-blocking risk remains beyond normal review.

Suggested reviewers: eduralph

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 55.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 20 functions across 3 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely identifies the primary change: upgrading the tonic and prost dependencies to version 0.14.
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.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

Some tools did not complete. Review the errors below.

🔧 Clippy (1.97.1)

Clippy execution failed


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.

mingley added 3 commits July 21, 2026 19:18
Signed-off-by: Michael Ingley <michael.ingley@gmail.com>
Signed-off-by: Michael Ingley <michael.ingley@gmail.com>
Signed-off-by: Michael Ingley <michael.ingley@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contribution This PR is from a community contributor. dco-signoff: yes Indicates the PR's author has signed the dco. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant