Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

fix: ListOffset interface returns an incorrect result #1747

Open
wants to merge 1 commit into
base: branch-2.9.2.24
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1129,7 +1129,10 @@ private CompletableFuture<Pair<Errors, Long>> fetchOffset(String topicName, Long
return;
}
if (position.compareTo(lac) > 0) {
partitionData.complete(Pair.of(Errors.NONE, latestOffset));
// If all the data expires, the entry of lac becomes -1,
// and the actual offset will be 1 smaller than LATEST,
// here is special treatment, add 1 back
partitionData.complete(Pair.of(Errors.NONE, latestOffset + 1));
} else {
MessageMetadataUtils.getOffsetOfPosition(managedLedger, position, false,
timestamp, skipMessagesWithoutIndex)
Expand Down