aloyszhang commented on PR #3329: URL: https://github.com/apache/bookkeeper/pull/3329#issuecomment-1539798146
There are two places that can trigger `checkpoint`. 1. the scheduled tasks in `SyncThread.doCheckpoint` 2. the ledgerDir write-cache full and then flush The second way is the root cause of data loss. If removing the `checkpointSource.checkpointComplete` logic in `flush`, then at this point we will not delete journal files. The scheduled task `SyncThread.doCheckpoint` will invoke `checkpointSource.checkpointComplete` and it's safe here to delete journal files since we have already flushed all write-caches for all ledger directories. WDYT @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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
