sumitagrawl commented on code in PR #7722:
URL: https://github.com/apache/ozone/pull/7722#discussion_r1969314797


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/ratis/OzoneManagerStateMachine.java:
##########
@@ -162,6 +167,10 @@ public void notifyLeaderChanged(RaftGroupMemberId 
groupMemberId,
     // Initialize OMHAMetrics
     ozoneManager.omHAMetricsInit(newLeaderId.toString());
     LOG.info("{}: leader changed to {}", groupMemberId, newLeaderId);
+    // if the node is leader (can be ready or not ready, need update index)
+    if (ozoneManager.getOmRatisServer().checkLeaderStatus() != 
OzoneManagerRatisServer.RaftServerStatus.NOT_LEADER) {
+      indexGenerator.onLeaderChange();

Review Comment:
   Ratis generate termIndex for below cases:
   1. transaction update via applyTransaction()
   2. notifyConfigChange for case of ratis internal book-keeping
   
   IndexGenerate will generate index in pre-ratis execution for every incoming 
request at leader node.
   
   So both can have different value, where mostly ratis index will be faster 
side.
   
   OM will use OM index for purpose of objectId and updateId generation as used 
currently.
   TermIndex will be used to handle replay of ratis log pending, and ensure 
nodes are in sync in upgrade prepare cases.
   
   So use case will be separated and hence will not have impact.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to