sumitagrawl commented on code in PR #4509:
URL: https://github.com/apache/ozone/pull/4509#discussion_r1186998674
##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/ContainerEndpoint.java:
##########
@@ -481,4 +489,83 @@ private List<ContainerBlockMetadata> getBlocks(
return blockIds;
}
+ @GET
+ @Path("/mismatch")
+ public Response getContainerMisMatchInsights() {
+ List<ContainerDiscrepancyInfo> containerDiscrepancyInfoList =
+ new ArrayList<>();
+ try {
+ Map<Long, ContainerMetadata> omContainers =
+ reconContainerMetadataManager.getContainers(-1, -1);
+ List<Long> scmAllContainers = containerManager.getContainers().stream()
+ .map(containerInfo -> containerInfo.getContainerID()).collect(
+ Collectors.toList());
+ List<Long> scmNonDeletedContainers =
+ containerManager.getContainers().stream()
+ .filter(containerInfo -> !(containerInfo.getState() ==
+ HddsProtos.LifeCycleState.DELETED))
+ .map(containerInfo -> containerInfo.getContainerID()).collect(
+ Collectors.toList());
+
+ // Filter list of container Ids which are present in OM but not in SCM.
+ List<Map.Entry<Long, ContainerMetadata>> notSCMContainers =
+ omContainers.entrySet().stream().filter(containerMetadataEntry ->
+
!(scmAllContainers.contains(containerMetadataEntry.getKey())))
Review Comment:
@devmadhuu We should not count deleted SCM container for comparing to OM
also, deleted container is just a bookmark, to avoid re-created same container
at DN due to issue with sync at DN or Old DN.
This needs to be removed in comparison here tool.
--
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]