oneby-wang opened a new pull request, #25796: URL: https://github.com/apache/pulsar/pull/25796
### Motivation This is a follow-up to apache/pulsar#25165 for the same class of race condition, covering `ManagedLedgerImpl.advanceCursorsIfNecessary()` and non-durable cursor properties. `ManagedLedgerImpl.advanceCursorsIfNecessary()` method may lose non-durable cursor mark-delete properties in a race condition. When `advanceCursorsIfNecessary()` advances a non-durable cursor while another `markDelete()` call with properties is in progress, passing the cursor current properties can capture stale properties and later overwrite the user-provided mark-delete properties. ### Modifications 1. Add `testAdvanceCursorsIfNecessaryNeverLoseProperties()` test to reproduce the issue. 2. Pass `null` to `asyncMarkDelete()` method properties param in `advanceCursorsIfNecessary()` method, so the cursor uses the latest properties when the mark-delete is applied. 3. Run test to verify the code change. ### Verifying this change - [x] Make sure that the change passes the CI checks. ### 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 ### Documentation <!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. --> - [ ] `doc` <!-- Your PR contains doc changes. --> - [ ] `doc-required` <!-- Your PR changes impact docs and you will update later --> - [x] `doc-not-needed` <!-- Your PR changes do not impact docs --> - [ ] `doc-complete` <!-- Docs have been already added --> ### Matching PR in forked repository PR in forked repository: https://github.com/oneby-wang/pulsar/pull/32 -- 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]
