sodonnel commented on code in PR #5678:
URL: https://github.com/apache/ozone/pull/5678#discussion_r1409472496


##########
hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/replication/health/TestRatisUnhealthyReplicationCheckHandler.java:
##########
@@ -366,29 +352,45 @@ public void overReplicationCheckWithQuasiClosedReplica() {
     final ContainerInfo container = ReplicationTestUtil.createContainerInfo(
         repConfig, 1, HddsProtos.LifeCycleState.CLOSED, sequenceID);
 
-    final Set<ContainerReplica> replicas = new HashSet<>(2);
-    replicas.add(createContainerReplica(container.containerID(), 0,
-        IN_SERVICE, State.CLOSED, sequenceID));
-    replicas.add(createContainerReplica(container.containerID(), 0,
-        IN_SERVICE, State.CLOSED, sequenceID));
-    replicas.add(createContainerReplica(container.containerID(), 0,
-        IN_SERVICE, State.CLOSED, sequenceID));
-
-    final ContainerReplica quasiClosedReplica =
-        createContainerReplica(container.containerID(), 0,
-            IN_SERVICE, State.QUASI_CLOSED, sequenceID - 1);
-    replicas.add(quasiClosedReplica);
+    Set<ContainerReplica> replicas = new HashSet<>(4);
+    for (int i = 0; i < 4; i++) {
+      replicas.add(createContainerReplica(container.containerID(), 0,
+          IN_SERVICE, State.QUASI_CLOSED, sequenceID - 1));

Review Comment:
   Here we have all replicas with a sequenceID less than the container, which 
is different to the original test - is this intentional?
   
   In this case, I guess we have 4 replicas all with "sequenceID - 1", so as 
they have the same sequence and it is less than that of the container, that is 
what makes the container unhealthy, right? Otherwise it would not be handled by 
this handler and the RatisReplicationCheckHandler would take care of it instead?



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