sarvekshayr commented on code in PR #9135:
URL: https://github.com/apache/ozone/pull/9135#discussion_r2512933706
##########
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/replicas/ContainerStateVerifier.java:
##########
@@ -101,11 +104,15 @@ public BlockVerificationResult
verifyBlock(DatanodeDetails datanode, OmKeyLocati
}
replicaCheckMsg.append(", Container state in SCM is
").append(containerInfoToken.getContainerState());
- if (pass) {
- return BlockVerificationResult.pass();
- } else {
- return BlockVerificationResult.failCheck(replicaCheckMsg.toString());
+ String replicationStatus =
checkReplicationStatus(keyLocation.getContainerID());
+ replicaCheckMsg.append(", ").append(replicationStatus);
+ if (replicationStatus.contains("REPLICATION_CHECK_FAILED")) {
+ pass = false;
}
+
+ // Always return failCheck to include replication status information in
the output
+ // This allows users to see replication health status even when
container state is good
+ return BlockVerificationResult.failCheck(replicaCheckMsg.toString());
Review Comment:
Expected output -
```
"keys" : [ {
"volumeName" : "cli-debug-volume27858",
"bucketName" : "cli-debug-bucket",
"name" : "testfile",
"blocks" : [ {
"containerID" : 1,
"blockID" : 115816896921600101,
"replicas" : [ {
"datanode" : {
"uuid" : "2f283b6f-b5e6-4af1-b4c3-348f157db1ae",
"hostname" : "ozonesecure-ha-datanode1-1.ozonesecure-ha_ozone_net"
},
"checks" : [ {
"type" : "containerState",
"completed" : true,
"pass" : false,
"failures" : [ {
"message" : "Replica state is UNHEALTHY, Container state in SCM
is CLOSED, UNDER_REPLICATED: 2/3 healthy replicas"
} ]
} ],
"replicaIndex" : 0
}, {
"datanode" : {
"uuid" : "a05d5ec6-901f-4e68-8dc4-eb087b3b7310",
"hostname" : "ozonesecure-ha-datanode3-1.ozonesecure-ha_ozone_net"
},
"checks" : [ {
"type" : "containerState",
"completed" : true,
"pass" : false,
"failures" : [ {
"message" : "Replica state is CLOSED, Container state in SCM is
CLOSED, UNDER_REPLICATED: 2/3 healthy replicas"
} ]
} ],
"replicaIndex" : 0
}, {
"datanode" : {
"uuid" : "d3b0810d-7630-4fe5-adea-047b815e3f24",
"hostname" : "ozonesecure-ha-datanode5-1.ozonesecure-ha_ozone_net"
},
"checks" : [ {
"type" : "containerState",
"completed" : true,
"pass" : false,
"failures" : [ {
"message" : "Replica state is CLOSED, Container state in SCM is
CLOSED, UNDER_REPLICATED: 2/3 healthy replicas"
} ]
} ],
"replicaIndex" : 0
} ]
} ],
"pass" : false
} ],
"pass" : false
}
```
--
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]