-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[fix][broker] Fence reset cursor by timestamp to avoid concurrent timestamp-based position lookups #25151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[fix][broker] Fence reset cursor by timestamp to avoid concurrent timestamp-based position lookups #25151
Conversation
lhotari
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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:
|
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