void-ptr974 opened a new pull request, #25955: URL: https://github.com/apache/pulsar/pull/25955
### Motivation Terminated topics can leave their final ledger in BookKeeper even when tiered-storage offload is enabled and the ledger is eligible for offload. Termination closes the current ledger outside the normal ledger rollover path. That means the final ledger is complete, but it is not handled like other closed ledgers for offload purposes. Its closed-ledger metadata is not refreshed during termination, automatic offload is not triggered from that path, and manual `offloadPrefix()` still excludes the last ledger as if it were active. As a result, terminated topic data can be only partially offloaded, with the final ledger continuing to consume BookKeeper storage. ### Modifications - Record closed-ledger metadata for the final ledger when a managed ledger is terminated. - Trigger automatic offload after the terminated state is persisted. - Allow manual offload to include the last ledger when the managed ledger is terminated and the requested position covers the terminated position. - Add managed-ledger tests for manual, automatic, bounded, and idempotent offload of the final ledger after termination. ### Verifying this change Ran: ```bash ./gradlew :managed-ledger:test --tests org.apache.bookkeeper.mledger.impl.OffloadPrefixTest --tests org.apache.bookkeeper.mledger.impl.ManagedLedgerTerminationTest --no-daemon ``` Result: `BUILD SUCCESSFUL`. -- 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]
