Josef Novak
2007-Apr-20 10:37 UTC
[Xapian-discuss] Flint Database 'Can't acquire write lock'?
Hi, I'm using xapian-core-0.9.9, built on a 64bit linux machine (Linux 2.4.21-143-smp x86_64 unknown ), employing a bash shell. I have successfully built several quartz databases of various sizes, and am trying to construct a flint database now, using the same code. As per the readme page ( http://wiki.xapian.org/FlintBackend_2fHowToCreateAFlintDatabase ) I tried: $ export XAPIAN_PREFER_FLINT=True however this then resulted in a 'Exception: Unable to acquire database write lock on test' message. If I then $ unset XAPIAN_PREFER_FLINT and rerun my program it builds the database without complaint. I was able to duplicate this sequence of events using the unchanged simpleindex program that can be found in the examples subdirectory of xapian-core-0.9.9. I started without specifying the XAPIAN_PREFER_FLINT environment variable, meaning (I think) that the resulting database should be built according to the quartz specification. First I created a simple test file, containing 3 entries, to index: --begin doc--- this is a test this is another test this is a third and final test --end doc-- I think ran the following command: $ cat test.txt | ./simpleindex testdb and searched the resulting db: $ ./simplesearch testdb/ test Performing query `Xapian::Query(test)' 3 results found ID 1 99% [this is a test] ID 2 99% [this is another test] ID 3 86% [this is a third and final test] Everything worked fine. I then exported the XAPIAN_PREFER_FLINT variable: $ export XAPIAN_PREFER_FLINT=True and attempted to rebuild the database after first deleting it: $ rm -rf testdb/ $ cat test.txt | ./simpleindex testdb Exception: Unable to acquire database write lock on testdb It didn't work, and I don't know why... I thought perhaps it was because I hadn't explicitly enabled flint during the configuration and build process (it is enabled by default though), so reran configure and recompiled with the --enable-backend-flint option set, but it was all to no avail. Any suggestions about what might be the root of this problem will be greatly appreciated. Perhaps I am just missing something really simple. Thanks, Joe
Olly Betts
2007-Apr-20 13:54 UTC
[Xapian-discuss] Flint Database 'Can't acquire write lock'?
On Fri, Apr 20, 2007 at 06:37:47PM +0900, Josef Novak wrote:> I'm using xapian-core-0.9.9, built on a 64bit linux machine > (Linux 2.4.21-143-smp x86_64 unknown ), employing a bash shell.Flint relies on fcntl() for locking, so perhaps the filing system you have the database on doesn't support this. What is the filing system? If it's NFS, make sure you're running 'lockd'. Quartz uses completely different locking technique which works on NFS without lockd, but it leaves a stale lock behind if the process exits unexpectedly, which is annoying. If it's not obviously the FS, can you try a snapshot tarball of SVN HEAD? There are have been some minor tweaks to the locking code: http://www.oligarchy.co.uk/xapian/trunk/ Cheers, Olly