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/08/14 01:34:36 UTC

[GitHub] reddycharan opened a new pull request #1600: Provide consistent locking mechanism in EntryLogManagerForEntryLogPerLedger

reddycharan opened a new pull request #1600: Provide consistent locking mechanism in EntryLogManagerForEntryLogPerLedger
URL: https://github.com/apache/bookkeeper/pull/1600
 
 
   Descriptions of the changes in this PR:
   
   Assumption: The lock stored alongside the EntryLog in this map is meant
   to be used to ensure that no two threads can be writing to the same
   ledger at the same time.
   
   The above invariant can be violated if the EntryLogAndLockTuple
   object is evicted from the cache while in a critical section nominally
   protected by the contained lock.
   
   The conditions required for this to happen would be pretty odd --
   there needs to be a huge amount of cache churn during one of
   the protected operations.
   
   The fix for this issue is to allocate in the constructor a fixed array of locks and select
   for each EntryLogAndLockTuple a lock from that array
   deterministically by ledgerId such that the same ledgerId
   will always get the same lock.

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