From c658f97d99c9c62c521e4793c52b9b1b53d71290 Mon Sep 17 00:00:00 2001 From: Ganesh Vernekar Date: Mon, 26 Jan 2026 13:05:36 -0800 Subject: [PATCH] Fix atomic variable alignment Signed-off-by: Ganesh Vernekar --- tsdb/fileutil/file_cache.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/tsdb/fileutil/file_cache.go b/tsdb/fileutil/file_cache.go index 326d01cbd5..f4915504ab 100644 --- a/tsdb/fileutil/file_cache.go +++ b/tsdb/fileutil/file_cache.go @@ -47,6 +47,11 @@ type cacheEntry struct { // FileCache is a shared LRU cache for file blocks. // It provides configurable memory limits, efficient eviction, and Prometheus metrics. type FileCache struct { + requests atomic.Uint64 // Total cache access attempts + misses atomic.Uint64 // Cache misses + evictions atomic.Uint64 // Number of evictions + nextFileID atomic.Uint64 // File ID counter for unique identification + mu sync.RWMutex maxSize int64 currentSize int64 @@ -58,15 +63,9 @@ type FileCache struct { pool sync.Pool // Metrics - all atomic for lock-free reads - requests atomic.Uint64 // Total cache access attempts - misses atomic.Uint64 // Cache misses - evictions atomic.Uint64 // Number of evictions // Prometheus metrics metrics *fileCacheMetrics - - // File ID counter for unique identification - nextFileID atomic.Uint64 } // fileCacheMetrics holds Prometheus metrics for the file cache.