v.25.11Improvement

Fix wrong FilesystemCacheBytes

Fix wrong FilesystemCacheBytes (and others) in system.asynchronous_metrics. Run SYSTEM queries on filesystem caches only once. Atomic view for caches that points to the same path in system.filesystem_caches. #89640 (Azat Khuzhin).
Fix incorrect values of FilesystemCacheBytes and other metrics in system.asynchronous_metrics, ensuring accurate reporting by running SYSTEM queries on filesystem caches only once and providing an atomic view for caches pointing to the same path in system.filesystem_caches.

Why it matters

The feature addresses inconsistencies and inaccuracies in filesystem cache-related metrics in ClickHouse. By running queries on filesystem caches only once and unifying views for caches referencing the same path, it improves metric reliability and reduces redundant system query executions, enhancing monitoring and performance diagnostics for users.

How to use it

Users automatically benefit from this fix after upgrading to the new ClickHouse version. No additional configuration or actions are required to enable the corrected metrics and atomic cache views in the system.asynchronous_metrics and system.filesystem_caches tables.