Siyao Meng created HDDS-16694:
---------------------------------
Summary: A failed snapshot load still increments
NumSnapshotCacheSize
Key: HDDS-16694
URL: https://issues.apache.org/jira/browse/HDDS-16694
Project: Apache Ozone
Issue Type: Bug
Reporter: Siyao Meng
Attachments: HDDS-16694-CR-T1-cache-size-gauge-drift.patch
h3. Mechanism
{{omMetrics.incNumSnapshotCacheSize()}} sits inside the {{v == null}} branch of
{{SnapshotCache.get}} ({{SnapshotCache.java:225-249}}) and runs even when the
load threw {{OMException(FILE_NOT_FOUND)}} and no map entry was created. Both
decrement sites require a mapped entry, so the gauge can only rise.
h3. Impact
The JMX {{NumSnapshotCacheSize}} gauge an operator uses to size the cache
drifts upward monotonically on a routine condition, namely reading an already
purged snapshot. Monitoring signal only, with no data or availability effect.
h3. Reproduction
{{repro/test_bugCR-T1_cache_size_gauge_drift.sh}}. Evidence in
{{repro/logs/ev-cr.log}}.
h3. Patch
{{HDDS-XXXXX-CR-T1-cache-size-gauge-drift.patch}} is attached. It applies to
20e6a1c0f6039248373efd3eb1d7f2afcf7f1535 and carries the fix plus a regression
test that was verified to fail without the fix and pass with it.
{code:none}
mvn test -pl hadoop-ozone/ozone-manager -Dtest=TestSnapshotCache
{code}
Found by code review of the OM snapshot cache under HDDS-15926, on commit
20e6a1c0f6039248373efd3eb1d7f2afcf7f1535. Generated with Specula (Claude Opus
5).
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]