[2.x] Fix wrong behavior of hasMessageAvailable after seeking by timestamp#342
Merged
Lanayx merged 2 commits intofsprojects:2.xfrom Jan 30, 2026
Merged
[2.x] Fix wrong behavior of hasMessageAvailable after seeking by timestamp#342Lanayx merged 2 commits intofsprojects:2.xfrom
Lanayx merged 2 commits intofsprojects:2.xfrom
Conversation
…sprojects#333) * Fix wrong results of hasMessageAvailable and readNext after seeking by timestamp * Remove HasSoughtByTimestamp and improve test (cherry picked from commit e894e66)
Contributor
Author
Member
|
@RobertIndie Before we do the backport can you please comment on the two issues
|
Member
Contributor
Author
Thanks! I pushed a PR to address both these issues: #344. |
Member
…sprojects#344) * Fix Reader HasMessageAvailable behavior after seeking by timestamp * Improve logic (cherry picked from commit 170cb2f)
Contributor
Author
I include that commit to this PR as well now.
Some of our users are still relying on version 2.x. |
Member
Right, but nobody uses versions above 2.16.0 |
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
Cherry-pick #333 to 2.x branch.
The reader's HasMessageAvailableAsync may return true after a timestamp-based seek, even if there are no available messages in the topic.
Modifications
Add a boolean flag
HasSoughtByTimestampto represent whether the last seek call accepts a timestamp. If it's true, don't takestartMessageIdinto comparison withlastMessageIdInBroker, just compare the mark-delete position and last position in the GetLastMessageId response.