smengcl commented on code in PR #6768:
URL: https://github.com/apache/ozone/pull/6768#discussion_r1628696090


##########
hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/XceiverClientRatis.java:
##########
@@ -152,7 +174,12 @@ public long updateCommitInfosMap(
               (address, index) -> proto.getCommitIndex()))
           .filter(Objects::nonNull);
     }
-    return stream.mapToLong(Long::longValue).min().orElse(0);
+    if (level == ReplicationLevel.ALL_COMMITTED) {
+      return stream.mapToLong(Long::longValue).min().orElse(0);
+    } else {
+      // if majority committed, then find the second large index
+      return 
stream.sorted(Comparator.reverseOrder()).limit(majority).skip(majority - 
1).findFirst().orElse(0L);
+    }

Review Comment:
   fyi In case of `MAJORITY_COMMITTED` that I observed in HDDS-10108, it is 
like:
   
   | Node | Commit Index |
   |------|--------------|
   | A    | 8            |
   | B    | 8            |
   | C    | 2            |
   
   2 nodes already goes past the commitIndex specified in watch(). With 1 node 
lagging behind.



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