laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-msc/+/28130 )
Change subject: db: Switch from 'synchronous = FULL' to 'synchronous = NORMAL' ......................................................................
db: Switch from 'synchronous = FULL' to 'synchronous = NORMAL'
As we're using WAL mode, it is not neccessary to use synchronous=FULL but rely on synchronous=NORMAL mode while still guaranteeing database consistency.
To do this, we can fix the typo in one of our two PRAGMA statements, and remove the other.
See https://www.sqlite.org/pragma.html#pragma_synchronous for the sqlite3 documentation on that topic.
Change-Id: Ie782f0fe90e7204c4d55cdb3948b728c348367d1 Closes: OS#5566 RelateD: OS#5564, OS#5563 --- M src/libmsc/db.c 1 file changed, 1 insertion(+), 10 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/30/28130/1
diff --git a/src/libmsc/db.c b/src/libmsc/db.c index 4c272c1..aa770d6 100644 --- a/src/libmsc/db.c +++ b/src/libmsc/db.c @@ -562,7 +562,7 @@ }
char *err_msg; - rc = sqlite3_exec(g_dbc->db, "PRAGMA journal_mode=WAL; PRAGMA synchonous = NORMAL;", 0, 0, &err_msg); + rc = sqlite3_exec(g_dbc->db, "PRAGMA journal_mode=WAL; PRAGMA synchronous = NORMAL;", 0, 0, &err_msg); if (rc != SQLITE_OK) { LOGP(DDB, LOGL_ERROR, "Unable to set Write-Ahead Logging: %s\n", err_msg); sqlite3_free(err_msg); @@ -624,13 +624,6 @@ return rc; }
-static int db_configure(struct db_context *dbc) -{ - const char *sync_stmts[] = { "PRAGMA synchronous = FULL" }; - - return db_run_statements(dbc, sync_stmts, ARRAY_SIZE(sync_stmts)); -} - int db_prepare(void) { unsigned int i; @@ -649,8 +642,6 @@ return -1; }
- db_configure(g_dbc); - /* prepare all SQL statements */ for (i = 0; i < ARRAY_SIZE(g_dbc->stmt); i++) { rc = sqlite3_prepare_v2(g_dbc->db, stmt_sql[i], -1,