hangc0276 commented on code in PR #3329:
URL: https://github.com/apache/bookkeeper/pull/3329#discussion_r900800828
##########
bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/Journal.java:
##########
@@ -660,7 +660,7 @@ static void writePaddingBytes(JournalChannel jc, ByteBuf
paddingBuffer, int jour
// Should data be fsynced on disk before triggering the callback
private final boolean syncData;
- private final LastLogMark lastLogMark = new LastLogMark(0, 0);
+ private final LastLogMark lastLogMark = new LastLogMark(Long.MAX_VALUE,
Long.MAX_VALUE);
Review Comment:
When creating a Journal instance, it will initiate `lastLogMark` by reading
each ledger directory's `lastMark` file and get the minimum position as the
replay start point. So we should init lastLogMark with the MAX_VALUE.
In fact, the original logic of init `lastLogMark` with 0, and get the
maximum position of all the ledger directory's `lastMark` file to init the
lastLogMark. IMO, it will lose data.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]