sijie commented on a change in pull request #677: Issue 659: Fix Checkpoint
logic in SortedLedgerStorage
URL: https://github.com/apache/bookkeeper/pull/677#discussion_r153378014
##########
File path:
bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/SortedLedgerStorage.java
##########
@@ -146,14 +165,9 @@ public ByteBuf getEntry(long ledgerId, long entryId)
throws IOException {
}
@Override
- public Checkpoint checkpoint(final Checkpoint checkpoint) throws
IOException {
- Checkpoint lastCheckpoint = checkpointHolder.getLastCheckpoint();
- // if checkpoint is less than last checkpoint, we don't need to do
checkpoint again.
- if (lastCheckpoint.compareTo(checkpoint) > 0) {
- return lastCheckpoint;
- }
+ public void checkpoint(final Checkpoint checkpoint) throws IOException {
Review comment:
1. we need this method. onSizeLimitReached only flush the memory to entry
log files. but it doesn't guarantee data to be flushed to disk. Indeed, it will
issue a checkpoint request to checkpointer (which is SyncThread). SyncThread
will do the actual checkpoint job. The checkpoint job will ensure the data
added before this `checkpoint` will be persisted in entry log files before it
update the marker in journal.
2. the argument `checkpoint` is used by memtable to compare if there are
data still in memtable that are not flushed to entry log files, when checkpoint
starts. it will be used for avoiding unnecessary flush during checkpointing.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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