vivek122000 opened a new pull request, #2647:
URL: https://github.com/apache/phoenix/pull/2647

   Consumers of the HAGroupStateListener pattern that cache callback state as 
their source of truth need a way to detect that the underlying ZK watcher has 
disconnected; otherwise their cached snapshot silently goes stale until Curator 
reconnects and delivers a fresh event.
   
   The flag already exists as a private volatile boolean on HAGroupStoreClient, 
toggled by the Curator ConnectionStateListener on CONNECTION_LOST / 
CONNECTION_SUSPENDED / CONNECTION_RECONNECTED. Today the only way to observe it 
from outside is to call one of the state-reading methods and match on the 
"HAGroupStoreClient is not healthy" IOException string, which is brittle and 
requires triggering a side-effectful read.
   
   This change adds:
   - HAGroupStoreClient#isHealthy(): direct public accessor for the flag.
   - HAGroupStoreManager#isHealthy(String): delegate that resolves the client 
for the named HA group and returns its health, consistent with the existing 
isMutationBlocked / isHAGroupOnClientStale / getHAGroupStoreRecord shape.
   
   The javadoc describes ZK connection liveness only: CONNECTION_RECONNECTED 
sets the flag back to true immediately, while Curator resyncs the 
PathChildrenCache asynchronously afterward, so consumers needing absolute 
freshness after a reconnect should re-read via getHAGroupStoreRecord().
   
   No behavior change; new accessors only. All existing state-reading methods 
retain their throw-on-unhealthy contract.


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