[PATCH] db: use WAL journaling mode for higher concurrency

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/OpenBSC@lists.osmocom.org/.

Alexey Shamrin shamrin at gmail.com
Thu Feb 20 23:04:53 UTC 2014


Peter, thank you for your comments!

On Fri, Feb 21, 2014 at 2:05 AM, Peter Stuge <peter at stuge.se> wrote:
> > WAL journaling mode is persistent; it stays in effect after closing and
> > reopening the database. WAL mode database requires SQLite >= 3.7.0.
> Think about this some more. It's not enough to state dependencies in
> a commit message, you need to put them in the build system. A patch
> to do this will need to touch configure.ac, and I think it would be
> wise to make the requirement optional.

Is it really needed in this particular case? OpenBSC would continue
working with SQLite < 3.7.0. It would just ignore `journal_mode = WAL`
and keep using `DELETE` mode. The only thing that won't work is
downgrading from newer SQLite to older while keeping the same database
file. Older SQLite would refuse to open the database that was once
opened in WAL mode. The file could be downgraded by changing
journal_mode on it. But only newer SQLite could do it. Do you think
something must be done about it?

> > All credit belongs Ivan Kluchnikov who diagnosed and fixed this issue.
> Then the commit should list him as author, right?

As far as I understand, Ivan noticed the problem, opened the database
with sqlite3 command, entered `PRAGMA journal_mode = WAL` and noticed
the problem was now gone. Then he told me about it and suggested to
write a patch. I found where to put this command in OpenBSC source,
tested that it indeed persists WAL mode in the file, wrote the commit
message and sent it to mailing list.

I don't know what this means about the commit authorship. I can do it
either way.

Alexey




More information about the OpenBSC mailing list