openinx commented on a change in pull request #467: HBASE-22802 Avoid temp
ByteBuffer allocation in FileIOEngine#read
URL: https://github.com/apache/hbase/pull/467#discussion_r312767807
##########
File path:
hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/BucketCache.java
##########
@@ -502,8 +504,10 @@ public Cacheable getBlock(BlockCacheKey key, boolean
caching, boolean repeat,
// block will use the refCnt of bucketEntry, which means if two
HFileBlock mapping to
// the same BucketEntry, then all of the three will share the same
refCnt.
Cacheable cachedBlock = ioEngine.read(bucketEntry);
- // RPC start to reference, so retain here.
- cachedBlock.retain();
+ if (ioEngine.usesSharedMemory()) {
Review comment:
One big concern here: now for exclusive memory IOEngine, the refCnt value
of all bucketEntry will be 1, means the reference from BucketCache, no RPC
reference. Then I think the BucketCache's eviction policy would always evict
those blocks despite that the RPC is still using the block, not say the memory
leak issue , but the eviction policy is evicting those RPC referring blocks
(violate the LRU ? )....
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services