hangc0276 commented on PR #3329:
URL: https://github.com/apache/bookkeeper/pull/3329#issuecomment-1547430443

   > 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
   `
   @aloyszhang Thanks for your suggestion. Yes, making the 
`SyncThread.doCheckpoint` the only endpoint is the simplest way to solve this 
problem. I updated the PR description, please help take a look, thanks.


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