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


##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/replication/health/EmptyContainerHandler.java:
##########
@@ -88,9 +88,9 @@ public boolean handle(ContainerCheckRequest request) {
   private boolean isContainerEmptyAndClosed(final ContainerInfo container,
       final Set<ContainerReplica> replicas) {
     return container.getState() == HddsProtos.LifeCycleState.CLOSED &&
-        container.getNumberOfKeys() == 0 && replicas.stream()

Review Comment:
   That makes sense but then we're not checking whether SCM expects a container 
to be empty on the basis of `ContainerInfo` (0 keys currently) against what the 
replicas are actually reporting. For example, consider an edge case where some 
replicas are empty and some are non empty because of arbitrary reasons. If the 
non empty replicas are lost, then `EmptyContainerHandler` will now mark this 
container as `EMPTY` on the basis of reports from other replicas. Whereas we 
probably want to call the container `MISSING`?



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