lhotari commented on code in PR #22221:
URL: https://github.com/apache/pulsar/pull/22221#discussion_r1565424011


##########
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java:
##########
@@ -1667,9 +1674,7 @@ void createNewOpAddEntryForNewLedger() {
             if (existsOp != null) {
                 // If op is used by another ledger handle, we need to close it 
and create a new one
                 if (existsOp.ledger != null) {
-                    existsOp.close();
-                    existsOp = OpAddEntry.createNoRetainBuffer(existsOp.ml, 
existsOp.data,
-                            existsOp.getNumberOfMessages(), existsOp.callback, 
existsOp.ctx);
+                    existsOp = 
existsOp.duplicateAndClose(currentLedgerTimeoutTriggered);

Review Comment:
   Not related to this change, but how does the reference count 
(`retain`/`release`) of the `ByteBuf data` in the duplicated op get handled? 



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