ha setup: check leader endpoints before mutating and wait until HA is healthy #16346
All Vouch review confidence checks passed
Residual risk 0.17 = Change Risk (0.40) × (1 − Review Confidence (0.57)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.40 · 309 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.343
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #16346"
general
weight: 0.35
acpana
Description
This change enhances
config-connector ha setupwith preflight endpoint verification and post-apply health waiting:1. Preflight Leader Endpoint Verification (Part 1):
- Before mutating GCP resources or cluster configurations,
executeSetupdescribes each GKE cluster viagcloud container clusters describe --format=json.- Adds a read-only
outputmethod tocommandRunnerthat runs in--dry-runand suppresses command printing.- Validates that every cluster exposes the leader endpoint required by other clusters (
Default,DNS, orPrivateIP), skipping clusters where replication is disabled.- Fails with actionable remediation commands (
errors.Join) if any cluster does not expose the required endpoint.- Warns on stderr (deduplicated) when cross-region network topology without global access, differing VPC networks, or authorized networks might block connections.
- Prints a one-line summary reporting which endpoint types were verified across clusters.
2. Wait Until HA is Healthy (Part 2):
- Adds
--wait(defaulttrue) and--wait-timeout(default5m) flags toha setup, rejecting non-positive timeout values.- Sets
cmd.SilenceUsage = trueafter flag validation.- After applying cluster configurations, polls every 5s reusing
executeStatusuntil multi-cluster HA status is healthy (haStateHealthy).- On success, prints a summary reporting the elected leader, standbys, and replication mode.
- On timeout, returns an error listing the last poll problems, confirming that configuration was applied and not rolled back, providing the
ha statuscommand to inspect, and adding a namespaced-mode restart note when applicable.- Supports skipping wait via
--wait=false(printing theha statuscommand),--dry-run(printing a[dry-run]wait notice), and--yaml-only.Fixes #16339
``
release-noteconfig-connector ha setup(Alpha)
checks that every cluster exposes the selected leader endpoint before it changes anything. After the changes, it waits until the clusters agree on a leader and the standbys sync, and then prints a summary. Use--wait=falseto skip the wait.
``This pull request was generated by an AI coding agent.
<sub>🤖 Agent session</sub>
<!-- factory:task-output kind=Change task=recipe-fix-20261123-223730-ccdf -->