hangc0276 commented on code in PR #3353:
URL: https://github.com/apache/bookkeeper/pull/3353#discussion_r905729497


##########
bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/storage/ldb/SingleDirectoryDbLedgerStorage.java:
##########
@@ -820,10 +820,12 @@ private void swapWriteCache() {
     }
 
     @Override
-    public void flush() throws IOException {
+    public void flush(boolean doCheckpointComplete) throws IOException {
         Checkpoint cp = checkpointSource.newCheckpoint();
         checkpoint(cp);
-        checkpointSource.checkpointComplete(cp, true);
+        if (doCheckpointComplete) {

Review Comment:
   It is a little strange that we flush the WriteCache data into OS PageCache 
without writing the checkpoint `lastMark` into ledger directory.



##########
bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/SyncThread.java:
##########
@@ -133,7 +133,7 @@ public Future requestFlush() {
     private void flush() {
         Checkpoint checkpoint = checkpointSource.newCheckpoint();

Review Comment:
   We create a checkpoint at line 134, and write the checkpoint lastMark 
position into ledger directory at line 152. There is a gap that the actually 
flushed lastMark position is less than write cache flushed position.



-- 
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]

Reply via email to