sodonnel commented on code in PR #3802:
URL: https://github.com/apache/ozone/pull/3802#discussion_r992137787
##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/replication/RatisContainerReplicaCount.java:
##########
@@ -247,7 +248,26 @@ public boolean isSufficientlyReplicated() {
}
/**
- * Return true is the container is over replicated. Decommission and
+ * Return true if the container is sufficiently replicated. Decommissioning
+ * and Decommissioned containers are ignored in this check, assuming they
will
+ * eventually be removed from the cluster.
+ * This check ignores inflight additions, if includePendingAdd is false,
+ * otherwise it will assume they complete ok.
+ *
+ * @return True if the container is sufficiently replicated and False
+ * otherwise.
+ */
+ public boolean isSufficientlyReplicated(boolean includePendingAdd) {
+ // Positive for under-rep, negative for over-rep
+ int delta = missingReplicas();
+ if (includePendingAdd) {
+ delta -= inFlightAdd;
+ }
+ return delta <= 0;
+ }
Review Comment:
I think you are correct - I have missed this. We should be removing the
inflight deletes as per the original method defined just above this one. I will
fix this and modidy a test to validate it.
--
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]