sijie opened a new pull request #1284: Improve FileInfoBackingCache
URL: https://github.com/apache/bookkeeper/pull/1284
 
 
   Descriptions of the changes in this PR:
   
   There are a couple of issues noticed in FileInfoBackingCache:
   
   1) There is a race condition in loadFileInfo between get-check and put. If 
concurrent loading happens, there might be a FileInfo loaded into the map after 
get-check. This can cause incorrect reference count on FileInfo.
   
   2) FileLoader is doing I/O operation which happens under a giant write lock.
   
   3) assert is typically not recommended since it is disabled at production 
runtime typically.
   
   *Changes*
   
   - Check whether fileinfo exists or not after getting write lock and before 
put
   - Move any I/O operations out of write lock
   - release the new FileInfo if concurrent puts happen
   - remove the usage of assert
   
   Beside that, switch to use ConcurrentLongHashMap to avoid boxing and 
unboxing.
   
   
   Related Issues:
   
   #913 #832 

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

Reply via email to