From 1fb3cdf8a83a06a9c09837b0218e74b80794372b Mon Sep 17 00:00:00 2001 From: Valentin Rothberg Date: Tue, 9 May 2023 15:48:04 +0200 Subject: [PATCH] sqlite: disable WAL mode As shown in #17831, WAL mode plays a role in causing `database is locked` errors. Those are errors, in theory, should not happen as the DB should busy wait. mattn/go-sqlite3/issues/274 has some comments indicating that the busy handler behaves differently in WAL mode which may be an explanation to the error. For now, let's disable WAL mode and only re-enable it when we have clearer understanding of what's going on. The upstream issue along with the SQLite documentation do not give me the clear guidance that I would need. [NO NEW TESTS NEEDED] - flake is only reproducible in CI. Fixes: #18356 Signed-off-by: Valentin Rothberg --- libpod/sqlite_state.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/libpod/sqlite_state.go b/libpod/sqlite_state.go index d435f10727..7c94c6f208 100644 --- a/libpod/sqlite_state.go +++ b/libpod/sqlite_state.go @@ -32,9 +32,7 @@ type SQLiteState struct { const ( // Deal with timezone automatically. sqliteOptionLocation = "_loc=auto" - // Set the journal mode (https://www.sqlite.org/pragma.html#pragma_journal_mode). - sqliteOptionJournal = "&_journal=WAL" - // Force WAL mode to fsync after each transaction (https://www.sqlite.org/pragma.html#pragma_synchronous). + // Force an fsync after each transaction (https://www.sqlite.org/pragma.html#pragma_synchronous). sqliteOptionSynchronous = "&_sync=FULL" // Allow foreign keys (https://www.sqlite.org/pragma.html#pragma_foreign_keys). sqliteOptionForeignKeys = "&_foreign_keys=1" @@ -44,7 +42,6 @@ const ( // Assembled sqlite options used when opening the database. sqliteOptions = "db.sql?" + sqliteOptionLocation + - sqliteOptionJournal + sqliteOptionSynchronous + sqliteOptionForeignKeys + sqliteOptionTXLock