about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2011-11-07T21·11+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2011-11-07T21·11+0000
commitc0b706213dad330bd51607ff73059c87f0ec5b93 (patch)
tree76a6db26221e8ce02cd3056c299927ccab386752
parenta6a3f3a8c26fdd6900880c13e924e6879d6c714c (diff)
* Boldly make SQLite WAL mode the default again. Hopefully the
  intermittent problems are gone by now.  WAL mode is preferrable
  because it does way fewer fsyncs.

-rw-r--r--configure.ac2
-rw-r--r--src/libstore/local-store.cc7
2 files changed, 4 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac
index 876e0a862ee8..6a1a0e913dee 100644
--- a/configure.ac
+++ b/configure.ac
@@ -255,7 +255,7 @@ AC_ARG_WITH(sqlite, AC_HELP_STRING([--with-sqlite=PATH],
   [prefix of SQLite]),
   sqlite=$withval, sqlite=)
 AM_CONDITIONAL(HAVE_SQLITE, test -n "$sqlite")
-SQLITE_VERSION=3070701
+SQLITE_VERSION=3070900
 AC_SUBST(SQLITE_VERSION)
 if test -z "$sqlite"; then
   sqlite_lib='${top_builddir}/externals/sqlite-autoconf-$(SQLITE_VERSION)/libsqlite3.la'
diff --git a/src/libstore/local-store.cc b/src/libstore/local-store.cc
index 702ff67e793e..06cadcb0ff0e 100644
--- a/src/libstore/local-store.cc
+++ b/src/libstore/local-store.cc
@@ -327,10 +327,9 @@ void LocalStore::openDB(bool create)
     if (sqlite3_exec(db, ("pragma synchronous = " + syncMode + ";").c_str(), 0, 0, 0) != SQLITE_OK)
         throwSQLiteError(db, "setting synchronous mode");
 
-    /* Set the SQLite journal mode.  WAL mode is fastest, but doesn't
-       seem entirely stable at the moment (Oct. 2010).  Thus, use
-       truncate mode by default. */
-    string mode = queryBoolSetting("use-sqlite-wal", false) ? "wal" : "truncate";
+    /* Set the SQLite journal mode.  WAL mode is fastest, so it's the
+       default. */
+    string mode = queryBoolSetting("use-sqlite-wal", true) ? "wal" : "truncate";
     string prevMode;
     {
         SQLiteStmt stmt;