You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2022/10/09 12:08:02 UTC

[GitHub] [ozone] Xushaohong opened a new pull request, #3814: HDDS-7302. Fix inaccurate container block count caused by missing block

Xushaohong opened a new pull request, #3814:
URL: https://github.com/apache/ozone/pull/3814

   ## What changes were proposed in this pull request?
   
   After the patch of [HDDS-7259](https://issues.apache.org/jira/browse/HDDS-7259),  the number of empty containers is accumulating and they are not deleted.  The reason is due to the incorrect block count. 
   
   The block count is increased each time of puttingBlock, so it should not decrease the missing block number.
   
   While the pending deletion block number is increased by counting the blocks in the TXN(missing blocks included), so missing block number should be reduced.
   ![企业微信截图_c3ed4b94-30bc-477a-bffa-b6a3210e08a7](https://user-images.githubusercontent.com/10106574/194755867-c8cdf454-2dc9-40b8-a5a8-b95a56d792d2.png)
   
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-7302
   
   ## How was this patch tested?
   
   UT . See supplement of UT
   


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


[GitHub] [ozone] kaijchen merged pull request #3814: HDDS-7302. Fix inaccurate container block count caused by missing block

Posted by GitBox <gi...@apache.org>.
kaijchen merged PR #3814:
URL: https://github.com/apache/ozone/pull/3814


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


[GitHub] [ozone] Xushaohong commented on a diff in pull request #3814: HDDS-7302. Fix inaccurate container block count caused by missing block

Posted by GitBox <gi...@apache.org>.
Xushaohong commented on code in PR #3814:
URL: https://github.com/apache/ozone/pull/3814#discussion_r990885110


##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/statemachine/background/BlockDeletingService.java:
##########
@@ -489,10 +488,11 @@ private ContainerBackgroundTaskResult deleteViaTransactionStore(
         Handler handler = Objects.requireNonNull(ozoneContainer.getDispatcher()
             .getHandler(container.getContainerType()));
 
-        Pair<Integer, Long> deleteBlocksResult =
+        DeleteTransactionStats deleteBlocksResult =
             deleteTransactions(delBlocks, handler, blockDataTable, container);
-        int deletedBlocksCount = deleteBlocksResult.getLeft();
-        long releasedBytes = deleteBlocksResult.getRight();
+        int deletedBlocksProceeded = deleteBlocksResult.getBlocksProcessed();

Review Comment:
   If we delete Txn, all blocks in the TXN will be processed, but part of them may not be recorded in the DB and thus those shall not be counted as deleted, only processed. 
   Only the blocks which successfully go through putBlock request and are recorded in DB should be counted as deleted here to ensure the block count calculation right.



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


[GitHub] [ozone] kaijchen commented on a diff in pull request #3814: HDDS-7302. Fix inaccurate container block count caused by missing block

Posted by GitBox <gi...@apache.org>.
kaijchen commented on code in PR #3814:
URL: https://github.com/apache/ozone/pull/3814#discussion_r990882692


##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/statemachine/background/BlockDeletingService.java:
##########
@@ -489,10 +488,11 @@ private ContainerBackgroundTaskResult deleteViaTransactionStore(
         Handler handler = Objects.requireNonNull(ozoneContainer.getDispatcher()
             .getHandler(container.getContainerType()));
 
-        Pair<Integer, Long> deleteBlocksResult =
+        DeleteTransactionStats deleteBlocksResult =
             deleteTransactions(delBlocks, handler, blockDataTable, container);
-        int deletedBlocksCount = deleteBlocksResult.getLeft();
-        long releasedBytes = deleteBlocksResult.getRight();
+        int deletedBlocksProceeded = deleteBlocksResult.getBlocksProcessed();

Review Comment:
   Why it's called `Proceeded` here?



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


[GitHub] [ozone] lokeshj1703 commented on a diff in pull request #3814: HDDS-7302. Fix inaccurate container block count caused by missing block

Posted by GitBox <gi...@apache.org>.
lokeshj1703 commented on code in PR #3814:
URL: https://github.com/apache/ozone/pull/3814#discussion_r990926151


##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/statemachine/background/BlockDeletingService.java:
##########
@@ -541,10 +541,11 @@ private ContainerBackgroundTaskResult deleteViaTransactionStore(
      * Delete the chunks for the given blocks.
      * Return the deletedBlocks count and number of bytes released.
      */
-    private Pair<Integer, Long> deleteTransactions(
+    private DeleteTransactionStats deleteTransactions(
         List<DeletedBlocksTransaction> delBlocks, Handler handler,
         Table<String, BlockData> blockDataTable, Container container)
         throws IOException {
+      int blocksMissed = 0;

Review Comment:
   Rename to `blocksProcessed` and increment it in the loop
   `for (Long blkLong : entry.getLocalIDList()) {`



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


[GitHub] [ozone] kaijchen commented on pull request #3814: HDDS-7302. Fix inaccurate container block count caused by missing block

Posted by GitBox <gi...@apache.org>.
kaijchen commented on PR #3814:
URL: https://github.com/apache/ozone/pull/3814#issuecomment-1272934574

   Thanks @Xushaohong for updating the PR, thanks @lokeshj1703 for the review.


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


[GitHub] [ozone] Xushaohong commented on a diff in pull request #3814: HDDS-7302. Fix inaccurate container block count caused by missing block

Posted by GitBox <gi...@apache.org>.
Xushaohong commented on code in PR #3814:
URL: https://github.com/apache/ozone/pull/3814#discussion_r990936883


##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/statemachine/background/BlockDeletingService.java:
##########
@@ -541,10 +541,11 @@ private ContainerBackgroundTaskResult deleteViaTransactionStore(
      * Delete the chunks for the given blocks.
      * Return the deletedBlocks count and number of bytes released.
      */
-    private Pair<Integer, Long> deleteTransactions(
+    private DeleteTransactionStats deleteTransactions(
         List<DeletedBlocksTransaction> delBlocks, Handler handler,
         Table<String, BlockData> blockDataTable, Container container)
         throws IOException {
+      int blocksMissed = 0;

Review Comment:
   Done~



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


[GitHub] [ozone] kaijchen commented on a diff in pull request #3814: HDDS-7302. Fix inaccurate container block count caused by missing block

Posted by GitBox <gi...@apache.org>.
kaijchen commented on code in PR #3814:
URL: https://github.com/apache/ozone/pull/3814#discussion_r990792660


##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/statemachine/background/BlockDeletingService.java:
##########
@@ -601,4 +603,32 @@ void apply(Table<?, DeletedBlocksTransaction> deleteTxnsTable,
   public BlockDeletingServiceMetrics getMetrics() {
     return metrics;
   }
+
+  /**
+   * The wrapper class of the result of deleting transactions.
+   */
+  private class DeleteTransactionStats {

Review Comment:
   This class should be static.
   
   ```suggestion
     private static class DeleteTransactionStats {
   ```



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


[GitHub] [ozone] kaijchen commented on a diff in pull request #3814: HDDS-7302. Fix inaccurate container block count caused by missing block

Posted by GitBox <gi...@apache.org>.
kaijchen commented on code in PR #3814:
URL: https://github.com/apache/ozone/pull/3814#discussion_r990885583


##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/statemachine/background/BlockDeletingService.java:
##########
@@ -489,10 +488,11 @@ private ContainerBackgroundTaskResult deleteViaTransactionStore(
         Handler handler = Objects.requireNonNull(ozoneContainer.getDispatcher()
             .getHandler(container.getContainerType()));
 
-        Pair<Integer, Long> deleteBlocksResult =
+        DeleteTransactionStats deleteBlocksResult =
             deleteTransactions(delBlocks, handler, blockDataTable, container);
-        int deletedBlocksCount = deleteBlocksResult.getLeft();
-        long releasedBytes = deleteBlocksResult.getRight();
+        int deletedBlocksProceeded = deleteBlocksResult.getBlocksProcessed();

Review Comment:
   So there is a typo here, isn't it?



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


[GitHub] [ozone] Xushaohong commented on a diff in pull request #3814: HDDS-7302. Fix inaccurate container block count caused by missing block

Posted by GitBox <gi...@apache.org>.
Xushaohong commented on code in PR #3814:
URL: https://github.com/apache/ozone/pull/3814#discussion_r990886547


##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/statemachine/background/BlockDeletingService.java:
##########
@@ -489,10 +488,11 @@ private ContainerBackgroundTaskResult deleteViaTransactionStore(
         Handler handler = Objects.requireNonNull(ozoneContainer.getDispatcher()
             .getHandler(container.getContainerType()));
 
-        Pair<Integer, Long> deleteBlocksResult =
+        DeleteTransactionStats deleteBlocksResult =
             deleteTransactions(delBlocks, handler, blockDataTable, container);
-        int deletedBlocksCount = deleteBlocksResult.getLeft();
-        long releasedBytes = deleteBlocksResult.getRight();
+        int deletedBlocksProceeded = deleteBlocksResult.getBlocksProcessed();

Review Comment:
   Oops, spelling mistake! thx for pointing out this.



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