karanmehta93 commented on a change in pull request #2090: Update and flush
lastLogMark when replaying journal
URL: https://github.com/apache/bookkeeper/pull/2090#discussion_r282685525
##########
File path:
bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/Journal.java
##########
@@ -821,6 +821,9 @@ public void scanJournal(long journalId, long journalPos,
JournalScanner scanner)
scanner.process(journalVersion, offset, recBuff);
}
}
+ // Update LastLogMark to EOF position after replaying journal
+ // After force flush of LedgerStorage, SyncThread will persist
this to disk
+ lastLogMark.setCurLogMark(journalId, recLog.fc.position());
Review comment:
Yes @reddycharan That's a good observation. As discussed offline, I am
refactoring the code to move the `replay()` method from Journal to Bookie,
since it's bookie's task to replay the journal. In that manner we can simplify
the logic of updating `LastLogMark`.
By doing this, we lose the information of the file pointer end, hence I am
arbitrarily updating it to `LONG.MAX_VALUE` since the FileChannel treats both
those cases similarly.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services