BewareMyPower opened a new pull request #10467: URL: https://github.com/apache/pulsar/pull/10467
### Motivation https://github.com/apache/pulsar/pull/9257 added an extra `ByteBuf` parameter to managed ledger's `AddEntryCallback#addComplete` so that broker can get a buffer view of the entry when it's persisted successfully. However, when a ledger is full and the rollover is triggered, the `addComplete` method will be triggered in `OpAddEntry#closeComplete` and the argument is null. ### Modifications - Extend the lifetime of `data` when `ledger.asyncClose` is called in `OpAddEntry#safeRun`, and pass the `data` to `cb.addComplete`, after that, release the `data`. - Make current test cover the ledger rollover case. ### Verifying this change - [ ] Make sure that the change passes the CI checks. This change is already covered by existing tests, such as *ManagedLedgerTest#asyncAddEntryWithoutError*. -- 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]
