You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "sodonnel (via GitHub)" <gi...@apache.org> on 2023/05/10 14:41:07 UTC

[GitHub] [ozone] sodonnel commented on a diff in pull request #4655: HDDS-8115. Do not use block count to determine if containers are empty.

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


##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/AbstractContainerReportHandler.java:
##########
@@ -361,6 +361,7 @@ private void updateContainerReplica(final DatanodeDetails datanodeDetails,
         .setKeyCount(replicaProto.getKeyCount())
         .setReplicaIndex(replicaProto.getReplicaIndex())
         .setBytesUsed(replicaProto.getUsed())
+        .setEmpty(replicaProto.getIsEmpty())

Review Comment:
   I wonder if there is a compatibility problem between versions here?
   
   If the DN software is newer than SCM, then things would work as before. That is fine.
   
   If SCM is upgraded to have this logic, but the DN is on an old version, it will never send "empty=true". and I think that if the container becomes empty at this time, it will never set empty=true later. So we could get a scenario where the container goes empty on the DN, the ICR is sent, but this logic defaults the isEmpty to false and then the container never gets its remove triggered by SCM.
   
   I think we need to check if the DN is sending isEmpty(), and if it is not, put back the old logic here, eg something like:
   
   ```
   if (replicaProto.hasIsEmpty()) {
       builder.setEmpty(replicaProto.getIsEmpty())
   } else {
       if (replicaProto.getKeyCount() == 0 && replicaProto.getUsed == 0) {
           builder.setEmpty(true);
       } else {
           builder.setEmpty(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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org