You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "kaijchen (via GitHub)" <gi...@apache.org> on 2023/01/29 03:55:44 UTC

[GitHub] [ozone] kaijchen commented on a diff in pull request #3655: HDDS-7091. Filter containers with pending deletion blocks before checking policy

kaijchen commented on code in PR #3655:
URL: https://github.com/apache/ozone/pull/3655#discussion_r1089860898


##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/statemachine/background/BlockDeletingService.java:
##########
@@ -180,6 +180,8 @@ public List<ContainerBlockInfo> chooseContainerForBlockDeletion(
       throws StorageContainerException {
     Map<Long, ContainerData> containerDataMap =
         ozoneContainer.getContainerSet().getContainerMap().entrySet().stream()
+            .filter(e -> ((KeyValueContainerData) e.getValue()
+                .getContainerData()).getNumPendingDeletionBlocks() > 0)

Review Comment:
   > NIT: I believe this should not be done it is true currently only BlockDeletingService is calling the function but if there is some other implementation it would ending up doing the calculation anyways. But this should also be fine
   
   Good point. However, if there is some other implementation, it would probably check some other condition instead of `entry.getNumPendingDeletionBlocks() > 0`.



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