Repository navigation
Conversation
|
Skipping CI for Draft Pull Request. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
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. Comment |
|
CodexM5 seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
Scope
Draft Rust VIP owner for #1317, based on the standalone SQL process from bb7133#290. The config projection selects exactly one backend cluster and uses that cluster's PD endpoints and TLS for a dedicated
/tiproxy/vip/<ip>/ownerelection. The Rust owner runs only with--standalone; the Go process retains VIP authority in dual-process mode.The owner removes a stale local address before readiness, waits for the SQL ready gate before campaigning, uses a 3-second session with a 1-second etcd request timeout, and binds the address after election. Keepalive continues during Linux add/delete commands and GARP bursts, which can exceed the lease TTL when commands are slow. It sends an initial GARP burst and bounded one-second refreshes. On controlled shutdown, an awaited pre-close removes the address and retires the owner before SQL drain. Main calls the barrier on all supervised termination paths.
The Linux adapter uses
ipfor exact-IP/prefix inspection and address changes, with noninteractivesudo ipfallback on permission errors. GARP uses directarpingor noninteractivesudo arping. This does not reproduce Go's raw-socket library GARP path and needs real Linux validation.Checks
make rust-lint(workspace): PASSmake rust-test(workspace): PASS, including address parsing and pre-close acknowledgement/fallback testsmake rust-build(workspace): PASSmake lint: fails on pre-existing Gopkg/controlbridge/helpers_test.gounusedrecordingHandlerdeclarations. This PR changes Rust, its Linux acceptance workflow, and its test script; it does not change Go source.go mod tidyleft no changes.Draft acceptance gate
No Linux host/network namespace is available in the local macOS workspace. The new
Rust VIP Linux acceptanceworkflow runs two real standalone processes in separate namespaces against one PD/TiDB, capturingip -j addr, election state, SQL results and timestamps for one holder, controlled close, restart, and whole-node/link loss. The first five runs, through 36213639260, failed SQL: the fixture's TiDB topology lacked a keyspace label, so standalone metering correctly rejected incomplete backend attribution after routing. The test now supplies a TiDB[labels] keyspaceconfiguration and verifies that PD publishes it before starting Rust.Head
78b0a941Linux run 36214270719 passed: the initial owner b, controlled handoff to a, b restart while a retained ownership, and a node/link loss followed by takeover by b each had exactly one bound VIP and successful SQL through it. Address snapshots, election records, backend topology, SQL events and an empty overlap sampler are in the run artifact. Follow-up headsc7b983a8and0264bf4bpassed SQL but did not prove GARP: the runner uses Thomas Habets ARPing 2.24 (-ifor interface), and-U -iwithout-S VIPsends with the node IP as source. Head5ad76d6badded-S VIP. Current exact headda5904d5Linux run 36215836966 passed SQL, single-owner and per-owner GARP checks: the initial a MAC, controlled takeover b MAC, and whole-node/link-loss takeover a MAC each broadcastwho-has VIP tell VIP. Address/election snapshots, MAC-bearing packet capture, SQL events, and an empty overlap sampler are in the artifact.The workflow does not yet prove process-only SIGKILL safety. The owner currently adds an address without a finite lifetime, and SIGKILL bypasses its delete path; a surviving interface may therefore retain the old VIP when another node acquires the expired lease. Persistent local delete failure has the same split-brain risk. The per-owner, on-wire GARP gate is now passing; resolve these address-fencing failure cases before marking this PR ready.