rjgoyln opened a new pull request, #11400: URL: https://github.com/apache/ozone/pull/11400
## What changes were proposed in this pull request? Reading a snapshot that has already been purged makes the cache loader fail with `FILE_NOT_FOUND`. `SnapshotCache.get` creates no cache entry in that case, yet still incremented `NumSnapshotCacheSize`. Both decrements require an entry, so each such read left the JMX gauge one higher than the real cache size for good. The gauge is now incremented only once the loader returns a snapshot. ## What is the link to the Apache JIRA https://issues.apache.org/jira/browse/HDDS-16694 ## How was this patch tested? The new `TestSnapshotCache#testGetInactiveSnapshotDoesNotIncrementCacheSize` fails on master (`expected: <0> but was: <1>`) and passes with the change; the other 27 tests in the class still pass. Generated-by: Claude Code (Opus 5.5) -- 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
