diff options
Diffstat (limited to 'src/libstore/local-store.cc')
-rw-r--r-- | src/libstore/local-store.cc | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/libstore/local-store.cc b/src/libstore/local-store.cc index 7bcbe3298..f5eaa9f5f 100644 --- a/src/libstore/local-store.cc +++ b/src/libstore/local-store.cc @@ -313,13 +313,13 @@ LocalStore::LocalStore(const Params & params) throw Error( "Your Nix store has a database in Berkeley DB format,\n" "which is no longer supported. To convert to the new format,\n" - "please upgrade Nix to version 0.12 first."); + "please use the original Nix version 0.12 first."); if (curSchema < 6) throw Error( "Your Nix store has a database in flat file format,\n" "which is no longer supported. To convert to the new format,\n" - "please upgrade Nix to version 1.11 first."); + "please use the original Nix version 1.11 first."); if (!lockFile(globalLock.get(), ltWrite, false)) { printInfo("waiting for exclusive access to the Nix store..."); @@ -550,7 +550,12 @@ void LocalStore::openDB(State & state, bool create) if (mode == "wal" ) { /* persist the WAL files when the DB connection is closed. * This allows for read-only connections without any write permissions - * on the state directory to succeed on a closed database. */ + * on the state directory to succeed on a closed database. Setting the + * journal_size_limit to 2^40 bytes results in the WAL files getting + * truncated to 0 on exit and limits the on disk size of the WAL files + * to 2^40 bytes following a checkpoint */ + if (sqlite3_exec(db, "pragma main.journal_size_limit = 1099511627776;", 0, 0, 0) != SQLITE_OK) + SQLiteError::throw_(db, "setting journal_size_limit"); int enable = 1; if (sqlite3_file_control(db, NULL, SQLITE_FCNTL_PERSIST_WAL, &enable) != SQLITE_OK) SQLiteError::throw_(db, "setting persistent WAL mode"); |