Technoboy- commented on code in PR #21915:
URL: https://github.com/apache/pulsar/pull/21915#discussion_r1460952010


##########
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedCursorImpl.java:
##########
@@ -2789,29 +2789,22 @@ public void skipNonRecoverableLedger(final long 
ledgerId){
         if (ledgerInfo == null) {
             return;
         }
-        lock.writeLock().lock();
         log.warn("[{}] [{}] Since the ledger [{}] is lost and the 
autoSkipNonRecoverableData is true, this ledger will"
                 + " be auto acknowledge in subscription", ledger.getName(), 
name, ledgerId);
-        try {
-            for (int i = 0; i < ledgerInfo.getEntries(); i++) {
-                if (!individualDeletedMessages.contains(ledgerId, i)) {
-                    asyncDelete(PositionImpl.get(ledgerId, i), new 
AsyncCallbacks.DeleteCallback() {
-                        @Override
-                        public void deleteComplete(Object ctx) {
-                            // ignore.
-                        }
+        for (int i = 0; i < ledgerInfo.getEntries(); i++) {
+            asyncDelete(PositionImpl.get(ledgerId, i), new 
AsyncCallbacks.DeleteCallback() {
+                @Override
+                public void deleteComplete(Object ctx) {
+                    // ignore.
+                }
 
-                        @Override
-                        public void deleteFailed(ManagedLedgerException ex, 
Object ctx) {
-                            // The method internalMarkDelete already handled 
the failure operation. We only need to
-                            // make sure the memory state is updated.
-                            // If the broker crashed, the non-recoverable 
ledger will be detected again.
-                        }
-                    }, null);
+                @Override
+                public void deleteFailed(ManagedLedgerException ex, Object 
ctx) {
+                    // The method internalMarkDelete already handled the 
failure operation. We only need to
+                    // make sure the memory state is updated.
+                    // If the broker crashed, the non-recoverable ledger will 
be detected again.
                 }
-            }
-        } finally {
-            lock.writeLock().unlock();
+            }, null);

Review Comment:
   I have helped with this because this is a regression; we need this for the 
3.2 release.



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