Skip to content

config: align native Rust configuration behavior with Go - #1414

Merged
ti-chi-bot[bot] merged 9 commits into
pingcap:rustfrom
djshow832:config
Nov 11, 2026
Merged

ti-chi-bot[bot] merged 9 commits into
pingcap:rustfrom
djshow832:config

Conversation

@djshow832

@djshow832 djshow832 commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator

What problem does this PR solve?

Issue Number: close #1408

Problem Summary:
A Go configuration cannot start the native Rust process. Validation, reload policy, CLI flags, and a few runtime paths differ from the Go implementation.

What is changed and how it works:

  • Accept the Go default enable-traffic-replay = true and still start SQL serving; capture and replay stay unimplemented.
  • Keep security.encryption-key-path for checksum compatibility and do not require the key at startup.
  • Match Go Config.Check for TLS minimum versions, relative paths, and a certificate without its key; the native handshake floor stays TLS 1.2.
  • Allow cluster-tls.skip-ca = true on TLS without a CA, and verify PD certificates by CA only.
  • Advertise ALPN h2 so PD answers with gRPC.
  • Log config-owner dial failures.
  • Add --advertise-addr and --config-info json, and publish a machine-readable reload/effect contract.
  • Treat api.proxy-protocol = v2 and the HA GARP fields as explicitly unsupported or inert.
  • Reload balance.routing-rule for routers created after the change, matching the Go process.
  • Install defaults when the configuration file is empty.
  • Serve a classic TiDB session when the keyspace is empty.
  • Hold a redirect until the transaction finishes instead of expiring it when the redirect is accepted.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Notable changes

  • Has configuration change
  • Has HTTP API interfaces change
  • Has tiproxyctl change
  • Other user behavior changes

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

None

@djshow832
djshow832 requested a review from bb7133 as a code owner November 11, 2026 03:16
@ti-chi-bot
ti-chi-bot Bot requested a review from YangKeao November 11, 2026 03:16
@coderabbitai

coderabbitai Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review: 1

  • release-*

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 90f02a1c-d714-43f8-bcd3-436f4acbe065

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
Pre-merge checks: Inconclusive 2

Failed Failed checks: 2 inconclusive

Check name Status Explanation Resolution
Title check Pending This assessment has not completed. The check will be retried on the next pre-merge check run.
Description check Pending This assessment has not completed. The check will be retried on the next pre-merge check run.
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@pingcap-cla-assistant

pingcap-cla-assistant Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@ti-chi-bot ti-chi-bot Bot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Nov 11, 2026
djshow832 and others added 8 commits November 11, 2026 15:29
Co-authored-by: Cursor <cursoragent@cursor.com>
PD serves gRPC and HTTP/1.1 on the same port. Without h2 ALPN the
server answers HTTP/1.1 and the HTTP/2 client reports FRAME_SIZE_ERROR.
Go skips metering for an empty keyspace and still proxies the session.
The Rust handshake treated that classic topology as a proxy error, so
every connection closed before a backend was attached.
The queue TTL was stamped as an absolute handshake deadline at acceptance, so a transaction held longer than that TTL failed the migration after commit.
The snapshot builder now follows Go's minimum TLS versions, but the
control-plane anchor still required the old rejection text. An empty
keyspace is classic topology, so the session stays up and metering
stays detached instead of failing the handshake.

Co-authored-by: Cursor <cursoragent@cursor.com>
@codecov-commenter

codecov-commenter commented Nov 11, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 76.78571% with 13 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (rust@2e51931). Learn more about missing BASE report.

Files with missing lines Patch % Lines
pkg/controlbridge/snapshot.go 75.92% 11 Missing and 2 partials ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             rust    #1414   +/-   ##
=======================================
  Coverage        ?   58.58%           
=======================================
  Files           ?      214           
  Lines           ?    29839           
  Branches        ?        0           
=======================================
  Hits            ?    17481           
  Misses          ?    10876           
  Partials        ?     1482           
Flag Coverage Δ
unit 58.58% <76.78%> (?)

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

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Pinned tokio, rustls, socket2, and futures-util were behind patched
releases. The newer futures-util no longer pulls unmaintained pin-utils,
and tokio-macros stays on the syn 2 line so the lockfile does not gain
a second syn.

Co-authored-by: Cursor <cursoragent@cursor.com>
@ti-chi-bot ti-chi-bot Bot added the lgtm label Nov 11, 2026
@ti-chi-bot

ti-chi-bot Bot commented Nov 11, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: YangKeao

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 commented Nov 11, 2026

Copy link
Copy Markdown

[LGTM Timeline notifier]

Timeline:

  • 2026-11-11 10:16:53.128067213 +0000 UTC m=+1266537.753217720: ☑️ agreed by YangKeao.

@ti-chi-bot ti-chi-bot Bot added the approved label Nov 11, 2026
@ti-chi-bot
ti-chi-bot Bot merged commit be937b9 into pingcap:rust Nov 11, 2026
59 checks passed
@djshow832
djshow832 deleted the config branch November 11, 2026 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved lgtm 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.

3 participants