tkhurana commented on code in PR #2577:
URL: https://github.com/apache/phoenix/pull/2577#discussion_r3633176362


##########
phoenix-core-server/src/main/java/org/apache/phoenix/replication/reader/ReplicationLogDiscoveryReplay.java:
##########
@@ -151,6 +170,13 @@ public void init() throws IOException {
           clusterType == ClusterType.LOCAL
             && 
HAGroupStoreRecord.HAGroupState.STANDBY_TO_ACTIVE.equals(toState)
         ) {
+          // Direct DEGRADED_STANDBY -> STANDBY_TO_ACTIVE skips the STANDBY 
event that normally
+          // drives recovery. If we are DEGRADED, schedule the rewind so 
replay() re-syncs from
+          // lastRoundInSync before shouldTriggerFailover() (which gates on 
SYNC) can promote.
+          // compareAndSet, not set: a listener firing while already SYNC 
(healthy failover) or
+          // SYNCED_RECOVERY (rewind already pending) must not clobber a good 
state.
+          replicationReplayState.compareAndSet(ReplicationReplayState.DEGRADED,

Review Comment:
   The return value of compareAndSet is ignored 



-- 
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]

Reply via email to