sodonnel commented on code in PR #4756:
URL: https://github.com/apache/ozone/pull/4756#discussion_r1202150186
##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/replication/ECUnderReplicationHandler.java:
##########
@@ -541,4 +552,100 @@ private static byte[] int2byte(List<Integer> src) {
}
return dst;
}
+
+ /**
+ * Deletes one UNHEALTHY replica so that its host datanode becomes available
+ * to host a healthy replica. This can be helpful if reconstruction or
+ * replication is blocked because DNs that follow the placement policy are
+ * not available as targets.
+ * @param replicaCount ECContainerReplicaCount object of this container
+ * @param deletionInFlight pending deletes of this container's replicas
+ */
+ private void checkAndRemoveUnhealthyReplica(
+ ECContainerReplicaCount replicaCount,
+ List<DatanodeDetails> deletionInFlight) {
+ if (!deletionInFlight.isEmpty()) {
+ LOG.debug("There are {} pending deletes. Completing them could " +
+ "free up nodes to fix under replication. Not deleting UNHEALTHY" +
+ " replicas in this iteration.", deletionInFlight.size());
+ return;
+ }
+
+ ContainerInfo container = replicaCount.getContainer();
+ // ensure that the container is recoverable
+ if (replicaCount.isUnrecoverable()) {
Review Comment:
The "recoverable" check ignores unhealthy as if they are not there, right?
So if the container is recoverable and there are unhealthy, we are safe to
remove the unhealthy, as there are enough remaining replicas to rebuild the
missing ones.
--
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]