siddhantsangwan commented on code in PR #4227:
URL: https://github.com/apache/ozone/pull/4227#discussion_r1102359872


##########
hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/replication/health/TestRatisReplicationCheckHandler.java:
##########
@@ -363,6 +363,28 @@ public void 
testHandlerReturnsFalseWhenAllReplicasAreUnhealthy() {
     Assert.assertFalse(result.isReplicatedOkAfterPending());
     Assert.assertFalse(result.underReplicatedDueToDecommission());
 
+    Assert.assertFalse(healthCheck.handle(requestBuilder.build()));
+    Assert.assertEquals(0, repQueue.underReplicatedQueueSize());
+    Assert.assertEquals(0, repQueue.overReplicatedQueueSize());
+    Assert.assertEquals(0, report.getStat(
+        ReplicationManagerReport.HealthState.UNDER_REPLICATED));

Review Comment:
   Handling all UNHEALTHY replicas works as it does in legacy. This is checked 
and queued for over/under rep in `RatisUnhealthyReplicationCheckHandler` and 
the required commands are created in `RatisOverReplicationHandler` and 
`RatisUnderReplicationHandler`.
   
   Point 5 is about situations where we have excess UNHEALTHY and mismatched 
replicas. `RatisReplicationCheckHandler` won't queue for over rep as long as 
there are some mismatched replicas. `RatisUnhealthyReplicationCheckHandler` is 
however still queuing them - this is inconsistent as you pointed out in [the 
comment 
above](https://github.com/apache/ozone/pull/4227#discussion_r1099303927). I can 
fix this by either making both checks more conservative (not queuing if there 
are mismatched replicas) or by just checking if we have replication factor 
number of matching replicas and then queuing.



-- 
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]

Reply via email to