You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "Denovo1998 (via GitHub)" <gi...@apache.org> on 2026/09/17 12:52:36 UTC
[PR] [fix][broker] Fail compacted reads when the compacted ledger is missing [pulsar]
Denovo1998 opened a new pull request, #26631:
URL: https://github.com/apache/pulsar/pull/26631
### Motivation
Cursor recovery can restore a stale `CompactedTopicLedger` property pointing to a ledger that a newer compaction has already deleted. The fallback introduced in #26512 clears the compaction state and reads the original topic data, but retention may have already removed some of those entries. This can silently return an incomplete key set and allow a subsequent compaction to persist that incomplete view.
Compacted reads should report the missing data explicitly, while ordinary readers and explicit compaction cleanup should remain usable.
### Modifications
- Preserve the failed context and compaction horizon when the compacted ledger is missing.
- Propagate ledger-open failures through `getLastCompactedPosition()`, including when the read position is beyond the compaction horizon.
- Allow cursor resets to use normal managed-ledger position validation when compacted data is unavailable, so ordinary readers can still seek.
- Clear the registered compaction state when the compaction subscription is explicitly deleted, even if its ledger cannot be opened.
- Synchronize context/horizon reset with registration and snapshot reads.
- Add real broker/bookie regression tests and update the existing cursor-recovery test.
### Verifying this change
- [x] Make sure that the change passes the CI checks.
*(Please pick either of the following options)*
This change is a trivial rework / code cleanup without any test coverage.
*(or)*
This change is already covered by existing tests, such as *(please describe tests)*.
*(or)*
This change added tests and can be verified as follows:
*(example:)*
- *Added integration tests for end-to-end deployment with large payloads (10MB)*
- *Extended integration test for recovery after broker failure*
### Does this pull request potentially affect one of the following parts:
<!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
*If the box was checked, please highlight the changes*
- [ ] Dependencies (add or upgrade a dependency)
- [ ] The public API
- [ ] The schema
- [ ] The default values of configurations
- [ ] The threading model
- [ ] The binary protocol
- [ ] The REST endpoints
- [ ] The admin CLI options
- [ ] The metrics
- [ ] Anything that affects deployment
--
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [fix][broker] Fail compacted reads when the compacted ledger is missing [pulsar]
Posted by "merlimat (via GitHub)" <gi...@apache.org>.
merlimat merged PR #26631:
URL: https://github.com/apache/pulsar/pull/26631
--
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org