You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PHOENIX-7973 :- Address review: reconcile diagnostics, interrupt handling, and endpoint/refresh test wiring
Follow-up to the reviewer's minor items on the two-endpoint CRR path (no
correctness/concurrency changes to the reconcile decision tree itself):
- getClusterRoleRecordFromEndpoint restructured so reconciliation runs OUTSIDE
both per-endpoint fetch try/catch blocks. A bug in reconcile now surfaces as
itself rather than being caught by a fetch catch, misattributed as an endpoint
failure, and silently degraded to a single-endpoint record.
- The cluster-1 failure path now logs the cluster-1 exception (WARN) before
falling back to cluster 2, so a cluster-1 failure (including an unchecked bug
such as an NPE) no longer vanishes when cluster 2 succeeds. The interrupt
status the fetch cleared is restored in a finally after the fallback fetch, so
a stale flag cannot pre-empt the blocking work while callers still observe
cancellation.
- On both cluster-1 fallback paths, if cluster 2 also fails the cluster-1
failure is retained via addSuppressed instead of being dropped: the CRR-Not-
Found path rethrows the original Not-Found (cluster-2 suppressed) so downstream
fallback still triggers, and the non-Not-Found path rethrows cluster 2's
exception with cluster 1's attached as suppressed, so the single propagating
exception carries both root causes.
- Corrected the reconcile carve-out comment (and its mirror in the test): a
newer-UNKNOWN-with-no-active record stays masked behind the usable record and
recovery comes from the next scheduled refresh (the poller runs only if the
usable record is itself non-active).
Tests added in HighAvailabilityGroupTest:
- testIsCausedByInterrupt: both interrupt marker types, wrapped, non-interrupt,
null, the depth-16 bound (within and beyond), and a cyclic cause chain.
- testRefreshDoesNotRollBackToOlderRecord: wires the refresh no-rollback branch
end to end (keeps the applied record, stays READY, no failover count, returns
true).
- testGetClusterRoleRecordFromEndpointWiring: pins url1->cluster1 / url2->cluster2
and that the applied record is threaded as current on the equal-version defer.
- Equal-version divergence with the applied record at a lower version than the
endpoints now covered (the non-first-load fall-through).
Small testability seams added: package-private @VisibleForTesting on
getClusterRoleRecordFromEndpoint, isCausedByInterrupt, a fetchClusterRoleRecord
per-endpoint seam, and getStateForTesting.
Generated-by: Claude Code (Opus 4.8)
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
0 commit comments