You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@bookkeeper.apache.org by GitBox <gi...@apache.org> on 2022/06/28 08:46:49 UTC

[GitHub] [bookkeeper] gaozhangmin commented on a diff in pull request #3353: Fix checkpointComplete invoked twice in SyncThread

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


##########
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:
   In SyncThread,  We can disableCheckpoint, just return without executing `checkpointSource.checkpointComplete(checkpoint, false);` I don't think this is strange.



##########
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:
   In SyncThread,  We can disableCheckpoint, just return without executing `checkpointSource.checkpointComplete(checkpoint, false);` I don't think this is strange. @hangc0276 



-- 
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: issues-unsubscribe@bookkeeper.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org