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


##########
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:
   I think changing the `<` to `!=` will cause prepare failures if a leader 
change happens after the snapshot is taken. See the description of #2288 



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