Skip to content

Conversation

@codelipenghui
Copy link
Contributor

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) to resetCursor(long timestamp) by sharing the internal resetCursorInternal() method.

Verifying this change

  • Added unit test testConcurrentResetCursorByTimestamp in SubscriptionSeekTest.java
  • Run: mvn -pl pulsar-broker -Dtest=SubscriptionSeekTest#testConcurrentResetCursorByTimestamp test

Documentation

  • doc-not-needed

codelipenghui added a commit to codelipenghui/incubator-pulsar that referenced this pull request Jan 16, 2026
@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Jan 16, 2026
@codelipenghui codelipenghui self-assigned this Jan 16, 2026
@codelipenghui codelipenghui added this to the 4.2.0 milestone Jan 16, 2026
@codelipenghui codelipenghui changed the title [fix][broker] Fence reset cursor by timestamp to avoid concurrent resets [fix][broker] Fence reset cursor by timestamp to avoid concurrent timestamp-based position lookups Jan 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/broker doc-not-needed Your PR changes do not impact docs ready-to-test release/4.0.9 release/4.1.3 type/bug The PR fixed a bug or issue reported a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant