Skip to content

backendcluster: leave metric ownership to Rust dataplane - #318

Merged
bb7133 merged 1 commit into
mainfrom
codex/task153-metric-owner-fix
Oct 14, 2026
Merged

bb7133 merged 1 commit into
mainfrom
codex/task153-metric-owner-fix

Conversation

@bb7133

@bb7133 bb7133 commented Oct 13, 2026

Copy link
Copy Markdown
Owner

What problem does this PR solve?

Issue Number: ref #223

Problem Summary:

When the Rust dataplane is enabled, the Go BackendReader still starts and campaigns for the same per-cluster metric_reader owner key as the Rust collector. If the Go candidate has the lower create revision, it wins while advertising the Go api.addr, whose listener has already been handed to Rust. The Rust collectors then remain followers and the elected CPU/memory history ages to zero after the retention window.

What is changed and how it works:

Keep the Go cluster reader allocated so query registration, manager snapshots, and API reads remain safe, but start its collection/election lifecycle only when rust-dataplane.enabled is false. Rust-dataplane mode therefore has one metric owner: the Rust collector on its dedicated owner endpoint. Go-dataplane behavior is unchanged.

The tests pin both sides of the contract: Go mode still creates a metric_reader owner, while Rust mode creates none from Go and still permits query registration and empty metric reads.

Check List

Tests

  • Unit test
    • go test ./pkg/manager/backendcluster
  • Integration test
    • Linux M5-P selected-cell run 38364092593 completed terminal SUCCESS on diagnostic head a9a931488dcb5e9d99f2c67803f379df12838eb9; this PR's product commit edcc0fe158b1216e3048293ce51f6038cc040bc7 is its ancestor and all later changes are integration-harness-only.
  • Manual test
    • Across config generation plus the retention window, the elected candidates stayed on the dedicated Rust endpoint, CPU/memory histories remained 3/3 and advanced for about 105 seconds, and the stale Go api.addr candidate was absent.
  • No code

Notable changes

  • Has configuration change
  • Has HTTP API interfaces change
  • Has tiproxyctl change
  • Other user behavior changes
    • Rust-dataplane mode no longer starts the legacy Go metric collection/election lifecycle.

Dataplane parity drift

  • Not applicable: no monitored Go dataplane file changes; this is a control-plane metric-owner handoff.

Release note

Prevent the legacy Go metric reader from competing with the Rust collector for metric ownership when the Rust dataplane is enabled.

@bb7133
bb7133 merged commit b8dbe7b into main Oct 14, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant