Xiao Liu created HBASE-30523:
--------------------------------
Summary: BucketCacheStats#getIOHitsPerSecond resets its time
window on every call
Key: HBASE-30523
URL: https://issues.apache.org/jira/browse/HBASE-30523
Project: HBase
Issue Type: Bug
Components: BlockCache
Reporter: Xiao Liu
Assignee: Xiao Liu
Fix For: 4.0.0-alpha-1, 2.7.0, 3.1.0, 3.0.1, 2.6.8, 2.5.17
{\{BucketCacheStats#getIOHitsPerSecond}} resets \{{lastLogTime}} on every call,
but \{{ioHitCount}} is only cleared in \{{reset()}}, which
\{{BucketCache#logStats}} calls every 5 minutes.
Since HBASE-4089, the RegionServer status page (\{{blockCacheLevel.jsp}}) also
calls it on every load. So:
* A page load t seconds after the last stats log makes the next logged
\{{IOhitsPerSecond}} 300 / (300 - t) times too high, or 0 if t > 299.
* The value on the page is wrong too, and two loads within 1 second show 0.
The fix is to make it a pure getter over the window since the last
\{{reset()}}, and move the window start update into \{{reset()}}.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)