szetszwo commented on code in PR #5891:
URL: https://github.com/apache/ozone/pull/5891#discussion_r1446337675


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/upgrade/OMPrepareRequest.java:
##########
@@ -222,16 +228,17 @@ private static void waitForLogIndex(long 
minOMDBFlushIndex,
    * This means that an OM cannot support 2 prepare requests in the
    * transaction pipeline (un-applied) at the same time.
    */
-  public static void takeSnapshotAndPurgeLogs(long prepareIndex,
+  public static void takeSnapshotAndPurgeLogs(long lastLogIndex,
       RaftServer.Division division) throws IOException {
     StateMachine stateMachine = division.getStateMachine();
     long snapshotIndex = stateMachine.takeSnapshot();
+    LOG.info("takeSnapshot at {} for lastLogIndex {}", snapshotIndex, 
lastLogIndex);
 
-    if (snapshotIndex < prepareIndex) {
+    if (snapshotIndex != lastLogIndex) {

Review Comment:
   @errose28 , you are right.  The log index may change so  `takeSnapshot()` 
could return a higher index.  Good catch!



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