From 415d570cf2f404ef560f5d6a5af73653e1ec6204 Mon Sep 17 00:00:00 2001 From: Marcus Holland-Moritz Date: Fri, 28 Mar 2025 22:30:54 +0100 Subject: [PATCH] fix(block_cache): don't prefetch blocks that are in the active list --- src/reader/internal/block_cache.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/reader/internal/block_cache.cpp b/src/reader/internal/block_cache.cpp index daaaba73..8d7bbf36 100644 --- a/src/reader/internal/block_cache.cpp +++ b/src/reader/internal/block_cache.cpp @@ -383,7 +383,8 @@ class block_cache_ final : public block_cache::impl { if (auto next = seq_access_detector_->prefetch()) { std::lock_guard lock(mx_); - if (cache_.findWithoutPromotion(*next) == cache_.end()) { + if (cache_.findWithoutPromotion(*next) == cache_.end() && + active_.find(*next) == active_.end()) { sequential_prefetches_.fetch_add(1, std::memory_order_relaxed); create_cached_block(*next, std::promise{}, 0, std::numeric_limits::max());