You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2022/04/08 17:10:04 UTC
[GitHub] [ozone] errose28 commented on a diff in pull request #3258: HDDS-6447. Refine SCM handling of unhealthy container replicas
errose28 commented on code in PR #3258:
URL: https://github.com/apache/ozone/pull/3258#discussion_r844541442
##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/ReplicationManager.java:
##########
@@ -1174,19 +1174,34 @@ private void handleUnderReplicatedContainer(final ContainerInfo container,
.stream()
.map(action -> action.datanode)
.collect(Collectors.toList());
- final List<DatanodeDetails> source = replicas.stream()
+ List<DatanodeDetails> source = replicas.stream()
.filter(r ->
r.getState() == State.QUASI_CLOSED ||
r.getState() == State.CLOSED)
// Exclude stale and dead nodes. This is particularly important for
// maintenance nodes, as the replicas will remain present in the
// container manager, even when they go dead.
- .filter(r ->
- getNodeStatus(r.getDatanodeDetails()).isHealthy())
+ .filter(r -> getNodeStatus(r.getDatanodeDetails()).isHealthy())
.filter(r -> !deletionInFlight.contains(r.getDatanodeDetails()))
.sorted((r1, r2) -> r2.getSequenceId().compareTo(r1.getSequenceId()))
.map(ContainerReplica::getDatanodeDetails)
.collect(Collectors.toList());
+
+ // If there is only 1 replica of a container remaining, replicate it
+ // even if it is unhealthy.
+ if (source.size() == 0 && replicas.size() == 1) {
Review Comment:
If the goal is to preserve unhealthy containers, shouldn't we replicate them if they are at all under replicated, not just the last remaining one?
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org