siddhantsangwan commented on code in PR #5592:
URL: https://github.com/apache/ozone/pull/5592#discussion_r1402124588
##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/replication/health/RatisReplicationCheckHandler.java:
##########
@@ -200,9 +213,37 @@ of UNHEALTHY replicas (such as 3 CLOSED and 1 UNHEALTHY
replicas of a
RatisContainerReplicaCount consideringUnhealthy =
new RatisContainerReplicaCount(container, replicas, replicaPendingOps,
minReplicasForMaintenance, true);
- boolean isOverReplicated = consideringUnhealthy.isOverReplicated(false);
- if (isOverReplicated) {
- return consideringUnhealthy.toOverHealthResult();
+
+ if (consideringUnhealthy.isOverReplicated(false)) {
+ if (container.getState() == HddsProtos.LifeCycleState.CLOSED) {
+ return consideringUnhealthy.toOverHealthResult();
+ } else if (container.getState()
+ == HddsProtos.LifeCycleState.QUASI_CLOSED) {
+ // If the container is quasi-closed and over replicated, we may have a
+ // case where the excess replica is an unhealthy one, but it has a
+ // unique origin and therefore should not be deleted. In this case,
+ // we should not mark the container as over replicated.
+ // We ignore pending deletes, as a container is still over replicated
+ // until the pending delete completes.
+ ContainerReplica toDelete = ReplicationManagerUtil
+ .selectUnhealthyReplicaForDelete(container, replicas, 0,
Review Comment:
`selectUnhealthyReplicaForDelete` returns null if there are pending deletes.
I think that's not we want? Could try using `findNonUniqueDeleteCandidates`
instead by passing in all replicas for both the parameters.
--
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]