Skip to content

HBASE-30453 BucketCache region cached size is not decremented on eviction for non-persistent IOEngines - #8737

Open
julianchandras wants to merge 2 commits into
apache:masterfrom
julianchandras:HBASE-30453
Open

julianchandras wants to merge 2 commits into
apache:masterfrom
julianchandras:HBASE-30453

Conversation

@julianchandras

Copy link
Copy Markdown

JIRA: https://issues.apache.org/jira/browse/HBASE-30432

regionCachedSize was decremented only in fileNotFullyCached, which blockEvicted calls only for persistent IOEngines, so offheap evictions were never subtracted. Moved the decrement into blockEvicted to mirror the increment in putIntoBackingMap.

This also fixes a double decrement in the persistent cache validation thread (evictBlock followed by fileNotFullyCached) that occurred before the fix.

Tests:

  • TestBucketCache#testRegionCachedSizeDecrementedOnEvictionForNonPersistentEngine
  • TestVerifyBucketCacheFile#testRegionCachedSizeAfterInvalidBlockEvictedOnValidation (double decrement)

// This computation should happen even if the file is not in fullyCachedFiles map.
updateRegionCachedSize(key, (entry.getLength() * -1));
fullyCachedFiles.remove(key.getHfileName());
private void fileNotFullyCached(String hfileName) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: since fileNotFullyCached now became a single liner delegation to fullyCachedFiles.remove, can we remove fileNotFullyCached altogether and simply call the fullyCachedFiles.remove directly?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

inlined fileNotFullyCached in e2e00bf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants