ChenSammi commented on code in PR #6768:
URL: https://github.com/apache/ozone/pull/6768#discussion_r1628719202
##########
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:
Return the lowest index is for ALL_COMMITTED watch. For majority watch, we
return the second lowest index(assume factor is 3).
--
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]