sodonnel commented on code in PR #4207:
URL: https://github.com/apache/ozone/pull/4207#discussion_r1086422448
##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/replication/LegacyReplicationManager.java:
##########
@@ -1612,6 +1613,20 @@ private boolean isOpenContainerHealthy(
.allMatch(r -> compareState(state, r.getState()));
}
+ private void setHealthStateForClosing(Set<ContainerReplica> replicas,
+ ContainerInfo container,
+ ReplicationManagerReport report) {
+ if (!replicas.stream().
+ anyMatch(r -> compareState(LifeCycleState.OPEN, r.getState()) ||
+ compareState(LifeCycleState.CLOSED, r.getState()))) {
+ report.incrementAndSample(HealthState.MISSING, container.containerID());
Review Comment:
The only way for a container to be "MISSING" is if there are no replicas at
all, as otherwise there is a replica available to read. So can we not just say
`if (replicas.size() == 0) ...` ?
--
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]