szetszwo commented on PR #906:
URL: https://github.com/apache/ratis/pull/906#issuecomment-1690396341

   Hi @OneSizeFitsQuorum , In Apache Ozone, we detect leader ready by the 
following steps
   
   1. Record the leader term in `notifyLeaderChanged`.
   
https://github.com/apache/ozone/blob/fcf5b17a4ede0c55c76aa337438498361c0a5dd3/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/ha/SCMStateMachine.java#L282-L283
   
   2. Compare the term in `notifyTermIndexUpdated` and check 
`DivisionInfo.isLeaderReady()`.
   
https://github.com/apache/ozone/blob/fcf5b17a4ede0c55c76aa337438498361c0a5dd3/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/ha/SCMStateMachine.java#L357-L361
   
   Please take a look if it is good for your use case.


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