[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/.

Holger Hans Peter Freyther holger at freyther.de
Fri Feb 21 12:53:02 UTC 2014


On Fri, Feb 21, 2014 at 02:00:01AM +0400, Alexey Shamrin wrote:

Hi,


> SQLite uses DELETE journaling mode by default. It became a problem on a
> real-world, actively used network (several hundred subscribers, several
> thousands SMS per day). Some location updates and SMS delivery marks
> were not getting written because database file was locked:
> 
> 2013-12-13_07:26:10.10665 <0002> gsm_subscriber.c:362 Subscriber 334020422525672 ATTACHED LAC=3
> 2013-12-13_07:26:10.10668 <000d> db.c:170 DBI: 5: database is locked
> 2013-12-13_07:26:10.10865 <000d> db.c:969 Failed to update Subscriber (by IMSI).

the answer right now is really not to access the database/tables from
outside. So the "fix" is really just a workaround and WAL does not come
for free either. In case you want to improve the database code please have
a look here[1]. In the long run our interface should be async, we should
use the DB APIs directly, use prepared statements, etc.

holger


[1] http://openbsc.osmocom.org/trac/wiki/Tasks/NITBAsyncDatabase





More information about the OpenBSC mailing list