oneby-wang opened a new pull request, #25862:
URL: https://github.com/apache/pulsar/pull/25862

   ### Motivation
   
   This is a follow-up to apache/pulsar#25165, apache/pulsar#25796, and 
apache/pulsar#25803 for the same class of mark-delete properties race 
condition, covering `ManagedCursorImpl.internalResetCursor()` for the 
compaction cursor.
   
   `ManagedCursorImpl.internalResetCursor()` may lose compaction cursor 
mark-delete properties in a race condition.
   
   When compaction cursor reset persists a mark-delete position while another 
`asyncMarkDelete()` call with properties is in progress, passing the cursor 
current properties can capture stale properties and later overwrite the 
compaction mark-delete properties, such as `CompactedTopicLedger`.
   
   ### Modifications
   
   1. Add `testCompactionCursorResetNeverLoseMarkDeleteProperties()` test to 
reproduce the issue.
   2. Pass `null` to `internalAsyncMarkDelete()` for compaction cursor reset, 
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] `./gradlew :managed-ledger:test --tests 
org.apache.bookkeeper.mledger.impl.ManagedCursorTest.testCompactionCursorResetNeverLoseMarkDeleteProperties`
   
   ### 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`
   - [ ] `doc-required`
   - [x] `doc-not-needed`
   - [ ] `doc-complete`


-- 
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]

Reply via email to