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



##########
File path: 
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java
##########
@@ -2547,21 +2582,15 @@ void internalTrimLedgers(boolean isTruncate, 
CompletableFuture<?> promise) {
             store.asyncUpdateLedgerIds(name, getManagedLedgerInfo(), 
ledgersStat, new MetaStoreCallback<Void>() {
                 @Override
                 public void operationComplete(Void result, Stat stat) {
+                    // perform actual deletion
+                    removeAllDeletableLedgers();

Review comment:
       The reason for performming `removeAllDeletableLedgers` synchronously 
here is that two locks of `trimmer` and `metadata` need to be released after 
the actual deletion. If the execution is asynchronous, the update process of 
the property map cannot be protected.




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