Create new header after truncation chkpt

This commit is contained in:
PThorpe92
2025-07-19 19:36:23 -04:00
committed by Jussi Saurio
parent b214c3dfc8
commit 49f90980d4

View File

@@ -1337,7 +1337,12 @@ impl WalFile {
shared.file.truncate(0, c.clone()).inspect_err(|e| {
handle_err(e);
})?;
let hdr = shared.wal_header.lock();
// sqlite just lets the next writer create it when the first frame is written.
// we can write the new header here for simplicity.
sqlite3_ondisk::begin_write_wal_header(&shared.file, &hdr).inspect_err(|e| {
handle_err(e);
})?;
let c = Completion::new_sync(|_| {
tracing::trace!("WAL file synced after truncation");
});