szetszwo commented on PR #8637:
URL: https://github.com/apache/ozone/pull/8637#issuecomment-2981197136

   > We actually make use of commit index in OzoneManager 
[here](https://github.com/apache/ozone/blob/48aefeaad09653e286ec4abbc6872e95d9fa1510/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/upgrade/OMPrepareRequest.java#L172).
 ...
   
   @nandakumar131 , Good catch!  We should change it to use 
`getLastAppliedTermIndex()`
   ```java
   +++ 
b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/upgrade/OMPrepareRequest.java
   @@ -185,7 +185,6 @@ private static long waitForLogIndex(long 
minOMDBFlushIndex,
        // If we purge logs without waiting for this index, it may not make it 
to
        // the RocksDB snapshot, and then the log entry is lost on this OM.
        long minRatisStateMachineIndex = minOMDBFlushIndex + 1; // for the 
ratis-metadata transaction
   -    long lastRatisCommitIndex = RaftLog.INVALID_LOG_INDEX;
    
        // Wait OM state machine to apply the given index.
        long lastOMDBFlushIndex = RaftLog.INVALID_LOG_INDEX;
   @@ -202,11 +201,10 @@ private static long waitForLogIndex(long 
minOMDBFlushIndex,
              lastOMDBFlushIndex);
    
          // Check ratis state machine.
   -      lastRatisCommitIndex = 
stateMachine.getLastNotifiedTermIndex().getIndex();
   -      ratisStateMachineApplied = (lastRatisCommitIndex >=
   -          minRatisStateMachineIndex);
   +      final long lastRatisAppliedIndex = 
stateMachine.getLastAppliedTermIndex().getIndex();
   +      ratisStateMachineApplied = lastRatisAppliedIndex >= 
minRatisStateMachineIndex;
          LOG.debug("{} Current Ratis state machine transaction index {}.",
   -          om.getOMNodeId(), lastRatisCommitIndex);
   +          om.getOMNodeId(), lastRatisAppliedIndex);
    
          if (!(omDBFlushed && ratisStateMachineApplied)) {
            Thread.sleep(flushCheckInterval.toMillis());
   ```


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