[OpenAFS] Re: experience of SQLite on AFS

Adam Megacz adam@megacz.com
Sat, 24 Apr 2010 20:23:39 +0000

Ken Dreyer <ktdreyer@ktdreyer.com> writes:
> SQLite has an option in os_unix.c (SQLITE_ENABLE_LOCKING_STYLE) to
> automatically figure out the database's filesystem type and use the
> most appropriate locking mechanism for that filesystem. Adam Megacz
> wrote a patch to SQLite back in 2006 that added AFS to this list of
> filesystems SQLite could detect. I'm not certain, but I think this
> only works for OSX (Adam, correct me if I'm wrong :-)

IIRC that is correct.  Also, DRHipp never merged the patch (even though
I sent him the legal papers he asked for).

> Additionally, SQLite also has the (undocumented?) ability to define a
> fixed locking style at compile-time with SQLITE_FIXED_LOCKING_STYLE.

I must hasten to add that I have never been able to get sqlite working
in a scenario where multiple client machines are concurrently accessing
the same database -- even when "whole file locking" is in use.  I
originally thought that using whole-file locks only (and no byte-range
locks) would work, but as far as I have been able to determine, it *does

> We hope we can make use of byte-range locking some day when OpenAFS
> supports this on *nix.

Me too, but my hopes are not high.  The fact that the databases become
corrupted when using whole-file locks only suggests that there is a more
subtle problem lurking here.

  - a