michaeljmarshall opened a new pull request, #4305:
URL: https://github.com/apache/bookkeeper/pull/4305

   Disclaimer: I am not very familiar with this code, so please review 
carefully.
   
   ### Motivation
   
   We use the `isFlushOngoing` and the `hasFlushBeenTriggered` atomic booleans 
to prevent concurrent flushes. See:
   
   
https://github.com/apache/bookkeeper/blob/2986e04f1057ba3da7c549b1479c187c9ba167f2/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/storage/ldb/SingleDirectoryDbLedgerStorage.java#L514-L530
   
   By my reading of the code, it seems there is a brief period of time where 
the calling code will think it is valid to flush, even though there is a flush 
in progress.
   
   ### Changes
   
   In the `SingleDirectoryDbLedgerStorage#swapWriteCache` method modified by 
this PR, I propose a change to set `isFlushOngoing` to true before setting 
`hasFlushBeenTriggered` to false.
   
   Master Issue: none
   


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