From 9b08f8c0f20664778ca0cd7e3aa2b5ffcf44b6c3 Mon Sep 17 00:00:00 2001 From: Nikita Sivukhin Date: Fri, 15 Aug 2025 13:13:33 +0400 Subject: [PATCH] set in-memory WAL information according to last commited frame - before that pages_in_frames, frame_cache and last_checksum was set to the latest written (not commited!) frame in the WAL found on disk --- core/storage/sqlite3_ondisk.rs | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/core/storage/sqlite3_ondisk.rs b/core/storage/sqlite3_ondisk.rs index eeb0417be..d033f49c2 100644 --- a/core/storage/sqlite3_ondisk.rs +++ b/core/storage/sqlite3_ondisk.rs @@ -1758,7 +1758,24 @@ pub fn read_entire_wal_dumb(file: &Arc) -> Result max_frame { + cached.pop(); + } + tracing::debug!("remove page {page} from the in-memory WAL index because it was past the last commited frame"); + } + pages_in_frames.truncate(max_frame as usize); + + wfs_data.nbackfills.store(0, Ordering::SeqCst); wfs_data.loaded.store(true, Ordering::SeqCst); });