Skip to content

Commit

Permalink
Switch client DB to sqlite synchronization mode NORMAL
Browse files Browse the repository at this point in the history
In a userbase of primarily gamers system instabilities aren't
that uncommon. Without synchronization of the user-db this can
lead to corruption of our client database storing the
user-certificate. We have had various reports of such issues
over time.

The current mode was set in 2010 in commit 9fee66e to speed
up the client-db "even more" though it is unclear whether we
actually had performance problems that required this step.

This patch switches the client synchronization mode from OFF
to NORMAL which according to the sqlite documentation will
leave a "very small" chance for database corruption but is
than the default FULL sync mode.

This commit should partially address issue mumble-voip#3254 by making
database corruption much more unlikely but detecting
corruption and/or handling DB backups are further possible
approaches if this change turns out to have unacceptable
performance or we get further reports of durability issues
with the clientside DB.
  • Loading branch information
hacst committed Oct 22, 2017
1 parent d2943a5 commit 12de49e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/mumble/Database.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ Database::Database() {

execQueryAndLogFailure(query, QLatin1String("VACUUM"));

execQueryAndLogFailure(query, QLatin1String("PRAGMA synchronous = OFF"));
execQueryAndLogFailure(query, QLatin1String("PRAGMA synchronous = NORMAL"));
#ifdef Q_OS_WIN
// Windows can not handle TRUNCATE with multiple connections to the DB. Thus less performant DELETE.
execQueryAndLogFailure(query, QLatin1String("PRAGMA journal_mode = DELETE"));
Expand Down

0 comments on commit 12de49e

Please sign in to comment.