siddhantsangwan commented on code in PR #4227:
URL: https://github.com/apache/ozone/pull/4227#discussion_r1093224423
##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/replication/RatisContainerReplicaCount.java:
##########
@@ -83,19 +86,26 @@ public RatisContainerReplicaCount(ContainerInfo container,
for (ContainerReplica cr : this.replicas) {
HddsProtos.NodeOperationalState state =
cr.getDatanodeDetails().getPersistedOpState();
+ if (cr.getState() == ContainerReplicaProto.State.UNHEALTHY) {
+ unhealthyReplicaCount++;
+ if (!considerUnhealthy) {
+ continue;
+ }
+ }
if (state == DECOMMISSIONED || state == DECOMMISSIONING) {
decommissionCount++;
} else if (state == IN_MAINTENANCE || state == ENTERING_MAINTENANCE) {
maintenanceCount++;
} else {
- if (cr.getState() == ContainerReplicaProto.State.UNHEALTHY) {
- unhealthyReplicaCount++;
- } else if (!LegacyReplicationManager.compareState(container.getState(),
- cr.getState())) {
+ if (!ReplicationManager.compareState(container.getState(),
+ cr.getState()) &&
+ cr.getState() != ContainerReplicaProto.State.UNHEALTHY) {
healthyReplicaCount++;
misMatchedReplicaCount++;
- } else {
+ } else if (ReplicationManager.compareState(container.getState(),
Review Comment:
Found a bug related to the counting here. Fixing it now.
--
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]