mwkang commented on PR #8469:
URL: https://github.com/apache/hbase/pull/8469#issuecomment-5088567752

   > > The leak is also reachable when IOEngine read, write, or sync errors 
persist beyond the configured tolerance duration: BucketCache disables itself 
while the RegionServer JVM continues running. It is therefore not limited to 
process shutdown.
   > 
   > For file based bucket cache, backingMap can grow quite large and 
traversing it to release references can be costly. Should we worry about this 
only when shutting down BC after exceeding IO errors thresholds, and ignoring 
it when doing RS shutdown?
   
   I did not special-case normal RegionServer shutdown to skip owner-reference 
cleanup.
   
   For a persistent file-backed cache, normal shutdown already traverses 
backingMap to serialize the checkpoint. The current implementation releases 
each owner reference through a callback in that same serializer pass, after 
copying the entry into the persistence image. After successful persistence, 
backingMap is empty, so cleanupCacheIndex does not perform a second full-map 
iteration. The fallback traversal only visits entries left behind when 
persistence fails.
   
   This avoids an additional full traversal on the normal persistent shutdown 
path, while still releasing the references. I have not benchmarked this with a 
very large backing map, so this conclusion is based on the traversal structure 
rather than measured results.


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

Reply via email to