You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "void-ptr974 (via GitHub)" <gi...@apache.org> on 2026/09/13 10:14:38 UTC
[PR] [fix][ml] Avoid cursor lock inversion when skipping lost entries [pulsar]
void-ptr974 opened a new pull request, #26570:
URL: https://github.com/apache/pulsar/pull/26570
### Motivation
Managed cursor mark-delete persistence acquires `pendingMarkDeleteOps` before taking the cursor read lock. `skipNonRecoverableEntries` previously held the cursor write lock while calling `asyncDelete`, which then attempted to acquire `pendingMarkDeleteOps`. A concurrent mark-delete persistence operation could therefore form a circular wait and stop cursor progress.
### Modifications
- Submit the complete non-recoverable entry range through one iterable `asyncDelete` call without an outer cursor write lock.
- Add a regression test that holds `pendingMarkDeleteOps` while a skip is submitted and verifies that the cursor read lock remains available.
### Verifying this change
- [x] Make sure that the change passes the CI checks.
This change added tests and can be verified as follows:
- `./gradlew :managed-ledger:checkstyleMain :managed-ledger:checkstyleTest :managed-ledger:test --tests org.apache.bookkeeper.mledger.impl.ManagedCursorTest.testSkipNonRecoverableEntries --tests org.apache.bookkeeper.mledger.impl.ManagedCursorTest.testSkipNonRecoverableEntriesDoesNotHoldCursorLockWhilePersisting`
### Does this pull request potentially affect one of the following parts:
- [ ] Dependencies (add or upgrade a dependency)
- [ ] The public API
- [ ] The schema
- [ ] The default values of configurations
- [x] The threading model
- [ ] The binary protocol
- [ ] The REST endpoints
- [ ] The admin CLI options
- [ ] The metrics
- [ ] Anything that affects deployment
The threading-model impact is limited to removing nested cursor-lock acquisition from the non-recoverable-entry skip path.
--
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] Fix cursor deadlock when skipping non-recoverable entries during mark-delete persistence [pulsar]
Posted by "merlimat (via GitHub)" <gi...@apache.org>.
merlimat closed pull request #26570: [fix] Fix cursor deadlock when skipping non-recoverable entries during mark-delete persistence
URL: https://github.com/apache/pulsar/pull/26570
--
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] Fix cursor deadlock when skipping non-recoverable entries during mark-delete persistence [pulsar]
Posted by "merlimat (via GitHub)" <gi...@apache.org>.
merlimat merged PR #26570:
URL: https://github.com/apache/pulsar/pull/26570
--
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