MarvinCai commented on a change in pull request #10326:
URL: https://github.com/apache/pulsar/pull/10326#discussion_r620137588



##########
File path: 
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java
##########
@@ -3738,6 +3751,35 @@ public void setEntriesAddedCounter(long count) {
 
     private static final Logger log = 
LoggerFactory.getLogger(ManagedLedgerImpl.class);
 
+    @Override
+    public CompletableFuture<Void> asyncTruncate() {
+
+        final List<CompletableFuture<Void>> futures = Lists.newArrayList();
+        for (ManagedCursor cursor : cursors) {
+            final CompletableFuture<Void> future = new CompletableFuture<>();
+            cursor.asyncClearBacklog(new AsyncCallbacks.ClearBacklogCallback() 
{

Review comment:
       The original request is to delete retained message, retained messages 
are acknowledged messages, messages in backlog are unacknowledged messages.
   There are already dedicated commands to clear whole backlog or expire 
certain messages in backlog, for this command we should just delete as much as 
retained message(messages already consumed and acknowledge by all consumers) so 
we shouldn't clear backlog 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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to