fix(cli): tolerate stale candidate lease on healthy standby in ha status #16422
All Vouch review confidence checks passed
Residual risk 0.17 = Change Risk (0.39) × (1 − Review Confidence (0.57)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.39 · 243 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.329
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #16422"
general
weight: 0.35
acpana
On a standby cluster, KCC's manager does not refresh its own
MultiClusterLease.spec.renewTimewhile another cluster holds a live global lease. After 2 * LeaseDurationSeconds (30s),LeaderElector.AcquireOrRenewinmulticluster-leader-electionreturnsfmt.Errorf("candidate lease is stale")even though reading the lease from storage succeeded and updatedstatus.globalHolderIdentityandstatus.globalRenewTime.MultiClusterLeaseReconcilerthen setsBackendHealthy=False(Reason: "BackendError",Message: "failed to communicate with backend: candidate lease is stale").liveLeaseHolderinpkg/cli/cmd/ha/status_checks.gotreated anyBackendHealthy=Falsecondition as an immediate error, causingconfig-connector ha statusto reportHA Status: ERRORon healthy standby clusters after 30s.This change:
status.globalHolderIdentityandCandidateIdentity()before evaluating theBackendHealthycondition inliveLeaseHolder.BackendHealthy=Falseonly when the cluster is a standby (holder != ""andcandidate != holder) and the condition message contains"candidate lease is stale"."failed to read lease: ..."), stale candidate reporting on the leader (candidate == holder), and cases where no cluster holds the lease.MultiClusterLeaseReconcilerwith fake storage and client.Fixes #16407
``
release-note
``None
This pull request was generated by an AI coding agent.
<sub>🤖 Agent session</sub>
<!-- factory:task-output kind=Change task=recipe-fix-20261124-215906-fefa -->