sumitagrawl commented on code in PR #7031:
URL: https://github.com/apache/ozone/pull/7031#discussion_r1706407033


##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/statemachine/background/BlockDeletingTask.java:
##########
@@ -424,14 +426,24 @@ private DeleteTransactionStats deleteTransactions(
       List<DeletedBlocksTransaction> delBlocks, Handler handler,
       Table<String, BlockData> blockDataTable, Container container)
       throws IOException {
+
     int blocksProcessed = 0;
     int blocksDeleted = 0;
     long bytesReleased = 0;
     List<DeletedBlocksTransaction> deletedBlocksTxs = new ArrayList<>();
     Instant startTime = Instant.now();
 
+    // Track deleted blocks to avoid duplicate deletion
+    Set<Long> deletedBlockSet = new HashSet<>();
+
     for (DeletedBlocksTransaction entry : delBlocks) {
       for (Long blkLong : entry.getLocalIDList()) {
+        // Check if the block has already been deleted
+        if (deletedBlockSet.contains(blkLong)) {

Review Comment:
   IMO, not required as this do not provide any value. This can be a scenario 
of retry in om where retry of key deletion used to happen and retry is not a 
normal case.



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