Skip to content
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

Seek to the first one >= timestamp #6393

Merged
merged 3 commits into from
Feb 24, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -66,7 +66,7 @@ public void findMessages(final long timestamp, AsyncCallbacks.FindEntryCallback
MessageImpl msg = null;
try {
msg = MessageImpl.deserialize(entry.getDataBuffer());
return msg.getPublishTime() <= timestamp;
return msg.getPublishTime() < timestamp;
} catch (Exception e) {
log.error("[{}][{}] Error deserializing message for message position find", topicName, subName, e);
} finally {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,7 @@ public void findEntryComplete(Position position, Object ctx) {
"[{}][{}] Unable to find position for timestamp {}. Resetting cursor to first position {} in ledger",
topicName, subName, timestamp, finalPosition);
} else {
finalPosition = position;
finalPosition = position.getNext();
}
resetCursor(finalPosition, future);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,8 @@ public void testReaderWithTimeLong() throws Exception {
receivedMessageIds.add(msg.getMessageId());
}

assertEquals(receivedMessageIds.size(), totalMsg + 1);
assertEquals(receivedMessageIds.get(0), lastMsgId);
assertEquals(receivedMessageIds.size(), totalMsg);
assertEquals(receivedMessageIds.get(0), firstMsgId);

restartBroker();

Expand Down