merlimat opened a new pull request, #3830:
URL: https://github.com/apache/bookkeeper/pull/3830
### Motivation
In #3545 we have switched the `ForceWriteThread` to take advantage o
`BlockingQueue.drainTo()` method for reducing contention, though the core logic
of the force-write was not touched at the time.
The logic of force-write is quite complicated because it tries to group
multiple force-write requests in the queue by sending a new marker and grouping
them when the marker is received. This also leads to a bit of lag when there
are many requests coming in and the IO is stressed, as we're waiting a bit more
before issuing the fsync.
Instead, with the `drainTo()` approach we can greatly simplify the logic and
maintaining a strict fsync grouping:
1. drain all the force-write-requests available in the queue into a local
array list
2. perform the fsync
3. update the journal log mark to the position of the last fw request
4. trigger send-responses for all the requests
5. go back to read from the queue
--
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]