You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@bookkeeper.apache.org by GitBox <gi...@apache.org> on 2018/03/20 21:21:27 UTC

[GitHub] merlimat opened a new pull request #1280: Improve write rejection in DbLedgerStorage

merlimat opened a new pull request #1280: Improve write rejection in DbLedgerStorage 
URL: https://github.com/apache/bookkeeper/pull/1280
 
 
   This PR contain 2 changes that are much related to each other. 
   
   1. Changed DbLedgerStorage write cache read-write lock into a `StampedLock`
      Main reason for using `StampedLock` is that this lock is always taken as a "read" lock, when putting entries in the the cache. It is protecting for the swapping of the write cache when the flush is triggered. Most of the time, we have many threads acquiring the read-lock. `StampedLock` is better in this scenario because there isn't any contention in the optimistic path (just a double volatile read).
   
   2. Have a configurable throttle timing when the write cache is really full. 
       If we try to write faster than we can put data in the storage device, eventually both write caches will get full and we have to throttle writes. Added here a setting to configure the amount of time to block the thread (who's calling `Bookie.addEntry()`, it could be IO thread or a addEntryWorker depending on configuration).
      After the timeout, if we still weren't able to flush the write cache and insert the current entry, bookie will reject the write operation, without logging but rather using a counter to keep track of it.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services