eolivelli commented on a change in pull request #889: BP-14 Implementation of
WriteFlag.DEFERRED_SYNC on Journal
URL: https://github.com/apache/bookkeeper/pull/889#discussion_r159069381
##########
File path:
bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/Journal.java
##########
@@ -960,19 +974,31 @@ public void run() {
}
journalFlushWatcher.reset().start();
bc.flush(false);
+
+ for (int i = 0; i < toFlush.size(); i++) {
Review comment:
This is because I have to call the callback "before" line 1007, that is
requesting the fsync the file and firing the callbacks.
```
forceWriteRequests.put(createForceWriteRequest(logFile, logId,
lastFlushPosition,
toFlush, shouldRolloverJournal, false));
```
If I fire the callbacks "after" that line the callback could be fired by the
ForceWriteThread as well.
So I enqueue the callbacks (QueueEntry) into the threadpool and remove them
from the toFlush list.
The ForceWriteThread will find nulls for callbacks already fired
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services