lokiore commented on code in PR #2640:
URL: https://github.com/apache/phoenix/pull/2640#discussion_r4340235143
##########
phoenix-core/src/it/java/org/apache/phoenix/jdbc/HAGroupStoreManagerIT.java:
##########
@@ -743,6 +747,23 @@ public void
testE2EFailoverFromActiveNotInSyncWithAutomaticStateTransitions() th
waitForHAGroupState(cluster2HAManager, haGroupName,
HAGroupStoreRecord.HAGroupState.DEGRADED_STANDBY);
+ try {
+ cluster1HAManager.initiateFailoverOnActiveCluster(haGroupName);
+ fail("Failover from ACTIVE_NOT_IN_SYNC should be rejected");
+ } catch (InvalidClusterRoleTransitionException e) {
+ assertTrue(e.getMessage(),
e.getMessage().contains("store-and-forward"));
+ }
+ // Rejection lands well inside the anti-flap window, so the group cannot
have resynced yet.
Review Comment:
Good catch, thanks. Instead of widening the assertion, I moved the
`ReplicationLogGroup` creation (which owns the forwarder) to after the
rejection checks. Before that point nothing in the test can move the group from
ACTIVE_NOT_IN_SYNC back to ACTIVE_IN_SYNC: HA-store prewarm is off in this IT
and the test issues no mutations. So the strict ACTIVE_NOT_IN_SYNC /
DEGRADED_STANDBY assertions no longer depend on the anti-flap timing. The group
then starts in store-and-forward, the forwarder finds no backlog, and the rest
of the test (back to ACTIVE_IN_SYNC, then failover succeeds) is unchanged.
Fixed in 432e581c71.
_(Posted by Loki's Claude companion)_
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]