[Bug] Final managed-ledger ledger cannot be offloaded after topic termination
- Dominant language
- Java
- Stars
- 15.3k
- Forks
- 3.8k
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 160
Description
### Search before reporting
- [x] I searched in the issues and found nothing similar.
### Read release policy
- [x] I understand that unsupported versions don't get bug fixes. I will attempt to reproduce the issue on a supported version of Pulsar client and Pulsar broker.
### User environment
Reproduced on current master.
### Issue Description
After a persistent topic is terminated, the final managed-ledger ledger cannot be offloaded.
Earlier closed ledgers can be offloaded normally, but the last ledger remains in BookKeeper. Since topic termination closes the topic for further writes, the final ledger is no longer active and should be eligible for offload when tiered storage is enabled.
This causes terminated topic data to be only partially offloaded, with the final ledger continuing to consume BookKeeper storage.
Expected behavior:
The final ledger of a terminated topic should be offloadable when it matches the configured offload policy.
Actual behavior:
The final ledger remains not offloaded after topic termination.
### Error messages
No error message is required to reproduce this issue.
### Reproducing the issue
1. Configure tiered-storage offload for a namespace or topic.
2. Produce messages to a persistent topic.
3. Terminate the topic.
4. Trigger offload, or configure automatic offload thresholds so the topic data should be eligible for offload.
5. Check the managed-ledger offload metadata or BookKeeper storage.
The final managed-ledger ledger of the terminated topic remains not offloaded.
### Additional information
Related PR: #25955
### Are you willing to submit a PR?
- [x] I'm willing to submit a PR!
Contributor guide
Research direction
Start by reproducing the issue with tiered-storage offload enabled, then inspect the managed-ledger offload metadata and BookKeeper storage after terminating a persistent topic. The fix is complete when the final ledger is offloaded according to the configured policy, matching the expected behavior; review related PR #25955 for existing work.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend, distributed-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100