wuzhanpeng commented on a change in pull request #13575:
URL: https://github.com/apache/pulsar/pull/13575#discussion_r811046224



##########
File path: 
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java
##########
@@ -2523,7 +2541,25 @@ void internalTrimLedgers(boolean isTruncate, 
CompletableFuture<?> promise) {
             advanceCursorsIfNecessary(ledgersToDelete);
 
             PositionImpl currentLastConfirmedEntry = lastConfirmedEntry;
+
             // Update metadata
+            // Mark deletable ledgers
+            Set<Long> deletableLedgers = Stream
+                    .concat(

Review comment:
       There may be ledgers in both `ledgersToDelete` and 
`offloadedLedgersToDelete` that need to be deleted. They do have the potential 
to have duplicate ledgers and that's why `toSet` is used.




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


Reply via email to