Or, more precisely, which APR-util dbm implementations are safe to use
in a threaded MPM, if any?
mod_dav_svn maintains an activity database - a mapping of DAV-generated
identifiers to Subversion transaction id's. It implements this using
APR-util's dbm implementation, which may be BDB, gdbm, or one of several
other dbm-a-like implementations.
(Obviously, as BDB isn't safe to use by more than one user via NFS,
anyone considering using more than one mod_dav_svn server against the
same NFS filesystem should definitely not use the BDB implementation.
People with only one DAV server are probably safe. I guess.)
So the advice I've been giving people is to use the sdbm implementation,
which implements a pretty straightforward shared/exclusive
serialisation via fcntl() locks.
However, I've just noticed that there isn't any thread synchronisation
in sdbm, so I suspect that two threads can actually work together to
corrupt the activity database, given that POSIX locks are per-process.
So the upshot of this is that I _think_ we should be serialising our
apr_dbm_ open/read/close and open/write/close calls in
mod_dav_svn/activity.c against a per-process mutex. Not doing so means
that we're relying on the APR dbm implementation to provide thread
exclusion, which it doesn't appear to do.
Does this seem reasonable?
Received on Thu Apr 5 18:03:06 2007
- application/pgp-signature attachment: stored