[fix][broker] Fence reset cursor by timestamp to avoid concurrent timestamp-based position lookups#25151
Merged
lhotari merged 3 commits intoapache:masterfrom Jan 16, 2026
Conversation
codelipenghui
added a commit
to codelipenghui/incubator-pulsar
that referenced
this pull request
Jan 16, 2026
1 task
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #25151 +/- ##
=============================================
+ Coverage 37.41% 72.66% +35.25%
- Complexity 13148 33884 +20736
=============================================
Files 1899 1956 +57
Lines 150564 154736 +4172
Branches 17156 17643 +487
=============================================
+ Hits 56334 112440 +56106
+ Misses 86500 33345 -53155
- Partials 7730 8951 +1221
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
priyanshu-ctds
pushed a commit
to datastax/pulsar
that referenced
this pull request
Jan 20, 2026
…estamp-based position lookups (apache#25151) (cherry picked from commit 6a3066d) (cherry picked from commit 174a424)
srinath-ctds
pushed a commit
to datastax/pulsar
that referenced
this pull request
Jan 20, 2026
…estamp-based position lookups (apache#25151) (cherry picked from commit 6a3066d) (cherry picked from commit 174a424)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
The
resetCursor(long timestamp)method was not protected by the subscription fencing mechanism (IS_FENCED_UPDATER), allowing concurrent reset operations to interfere with one another. This may result in performance degradation during timestamp-based position lookups, particularly when tiered storage is enabled.Modifications
Apply the same fencing mechanism used by
resetCursor(Position)toresetCursor(long timestamp)by sharing the internalresetCursorInternal()method.Verifying this change
testConcurrentResetCursorByTimestampinSubscriptionSeekTest.javamvn -pl pulsar-broker -Dtest=SubscriptionSeekTest#testConcurrentResetCursorByTimestamp testDocumentation
doc-not-needed