From c6c80ca25c182774e8f1c9b728670ae92ee3a2b2 Mon Sep 17 00:00:00 2001 From: Adam Reichold Date: Sun, 12 May 2024 18:40:35 +0200 Subject: [PATCH] Stop trying to move pages into the read cache once it is full. --- src/tree_store/page_store/cached_file.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/tree_store/page_store/cached_file.rs b/src/tree_store/page_store/cached_file.rs index ce5cb247..ecb8ba5d 100644 --- a/src/tree_store/page_store/cached_file.rs +++ b/src/tree_store/page_store/cached_file.rs @@ -303,6 +303,7 @@ impl PagedCachedFile { } else { self.read_cache_bytes .fetch_sub(buffer.len(), Ordering::AcqRel); + break; } } for (offset, buffer) in write_buffer.low_pri_cache.iter_mut() { @@ -318,6 +319,7 @@ impl PagedCachedFile { } else { self.read_cache_bytes .fetch_sub(buffer.len(), Ordering::AcqRel); + break; } } self.write_buffer_bytes.store(0, Ordering::Release);