diff --git a/src/Interpreters/Cache/FileCache.cpp b/src/Interpreters/Cache/FileCache.cpp index 716fc3bbc53..ffe2c9b26f3 100644 --- a/src/Interpreters/Cache/FileCache.cpp +++ b/src/Interpreters/Cache/FileCache.cpp @@ -1016,6 +1016,7 @@ FileSegmentsHolderPtr FileCache::getSnapshot() { assertInitialized(); + auto cache_lock = cache_guard.lock(); auto lock = metadata.lock(); performDelayedRemovalOfDeletedKeysFromMetadata(lock);