[
https://issues.apache.org/jira/browse/HBASE-30394?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
huginn updated HBASE-30394:
---------------------------
Description:
TinyLfuBlockCache reports the aggregate cache size and entry count as data
block size and count, even though these APIs are intended to report
data-block-only statistics.
When TinyLfuBlockCache contains a mixture of data, index, or metadata blocks,
getCurrentDataSize() and getDataBlockCount() include all cached blocks because
they return the aggregate cache size and entry count. This can make cache
composition and capacity analysis misleading.
The fix is to track the size and count of data blocks separately during cache
insertion and removal, updating the counters only for blocks whose BlockType is
data.
was:
## What happens
TinyLfuBlockCache reports the aggregate cache size and entry count as data
block size and count, so the data-block statistics include index and metadata
blocks.
## When it happens
This occurs when TinyLfuBlockCache contains a mixture of data, index, or
metadata blocks and callers query getCurrentDataSize() or getDataBlockCount().
## Impact
The reported data block size and count are inaccurate, which can make cache
composition and capacity analysis misleading.
## Root cause
In TinyLfuBlockCache, getCurrentDataSize() returns getCurrentSize() and
getDataBlockCount() returns getBlockCount(). The insertion and eviction paths
do not maintain separate data-block counters.
## Proposed fix
Track the size and count of data blocks separately during cache insertion and
removal, updating the counters only for blocks whose BlockType is data.
## Reproduction
Testing evidence will be added by the reporter.
> Report data block size and count separately in TinyLfuBlockCache
> ----------------------------------------------------------------
>
> Key: HBASE-30394
> URL: https://issues.apache.org/jira/browse/HBASE-30394
> Project: HBase
> Issue Type: Bug
> Components: BlockCache
> Affects Versions: 2.4.11
> Reporter: huginn
> Priority: Major
> Labels: pull-request-available
>
> TinyLfuBlockCache reports the aggregate cache size and entry count as data
> block size and count, even though these APIs are intended to report
> data-block-only statistics.
> When TinyLfuBlockCache contains a mixture of data, index, or metadata blocks,
> getCurrentDataSize() and getDataBlockCount() include all cached blocks
> because they return the aggregate cache size and entry count. This can make
> cache composition and capacity analysis misleading.
> The fix is to track the size and count of data blocks separately during cache
> insertion and removal, updating the counters only for blocks whose BlockType
> is data.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)