From d20a33424fcb2154e0db0e06e57b0a7ac6fca716 Mon Sep 17 00:00:00 2001 From: kssenii Date: Thu, 18 Jan 2024 16:53:10 +0100 Subject: [PATCH] Fix race --- src/Interpreters/Cache/SLRUFileCachePriority.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Interpreters/Cache/SLRUFileCachePriority.h b/src/Interpreters/Cache/SLRUFileCachePriority.h index b9ea246bc83..bd38a76b1d3 100644 --- a/src/Interpreters/Cache/SLRUFileCachePriority.h +++ b/src/Interpreters/Cache/SLRUFileCachePriority.h @@ -82,7 +82,10 @@ private: SLRUFileCachePriority * cache_priority; mutable LRUIterator lru_iterator; - bool is_protected; + /// Atomic, + /// but needed only in order to do FileSegment::getInfo() without any lock, + /// which is done for system tables and logging. + std::atomic is_protected; }; }