forked from openzfs/zfs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CACHE-HITS ratio is wrong when scrub is running (openzfs#322)
The CACHE-HITS ratio percentage is calculated as `CacheHit` / `LookupForRead`. However, the agent also increments CacheHit when incrementing LookupForWrite (from `ZettaCache::heal()`). We call heal() when there's zettacache corruption, which should be very rare, but we also heal() for every scrub read. Because of this, when `zpool scrub` is running, the hits ratio is incorrectly high, often much more than 100%. Each write_block request results in a `ZettaCache::lookup_impl()`, to ensure that the block isn't already present due to a kernel crash. However, this is an implementation detail, and we expect these lookups to rarely hit, and to always find the index entry in the index chunk cache. So we don't need these "lookups" to show up in any kind of accounting. This commit revamps the cache hits accounting by counting only (and all) non-write lookups.
- Loading branch information
Showing
5 changed files
with
63 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters