Hi there, My web app uses Xapian via the PHP bindings. I'm getting this error thrown occasionally when atempting to instantiate a XapianDatabase object for searching. DatabaseCorruptError: Expected block 107 to be level 1, not 0 Here's the line that invokes it: $database = new XapianDatabase(PROJROOT.'/data/xapian/posts'); And my version is xapian-core 1.2.3 with matchspy. Any ideas? Is it likely to be because the index is being updated by the indexer at the same time? Is there a way to avoid getting the above error? To be clear, it does work most of the time, but very occasionally throws the above. Andrew
On Mon, Jan 17, 2011 at 11:27:29AM +0000, Andrew Betts wrote:> DatabaseCorruptError: Expected block 107 to be level 1, not 0 > > Here's the line that invokes it: > > $database = new XapianDatabase(PROJROOT.'/data/xapian/posts'); > > And my version is xapian-core 1.2.3 with matchspy. Any ideas? Is it > likely to be because the index is being updated by the indexer at the > same time? Is there a way to avoid getting the above error? To be > clear, it does work most of the time, but very occasionally throws the > above.Well, the message is saying the database is corrupt, but I'm surprised that it would only happen erratically on opening - I would expect it to be repeatable. If you run xapian-check on the database what does it say? Best to disable updates while you run it. Cheers, Olly
It is the second time my xapian database corrupt. :-(>>> conn = xappy.IndexerConnection(dbpath)Traceback (most recent call last): File "<console>", line 1, in <module> File "build/bdist.linux-x86_64/egg/xappy/indexerconnection.py", line 49, in __init__ self._index = log(xapian.WritableDatabase, indexpath, xapian.DB_CREATE_OR_OPEN) File "build/bdist.linux-x86_64/egg/xappy/replaylog.py", line 413, in log return call(*args) File "/usr/lib/python2.6/dist-packages/xapian.py", line 3195, in __init__ _xapian.WritableDatabase_swiginit(self,_xapian.new_WritableDatabase(*args)) DatabaseCorruptError: Db block overwritten - are there multiple writers? when I use xapian-check: Database couldn't be opened for reading: DatabaseModifiedError: The revision being read has been discarded - you should call Xapian::Database::reopen() and retry the operation Continuing check anyway record: baseA blocksize=8K items=250 lastblock=22 revision=749 levels=1 root=4294967295 Segmentation fault Last time when it corrupt, my xapian dabase is huge, it indexed about 3,000,000 documents. But this time, the number is less than 200. Most important, I fount no way to fix the problem. I think database repairing is a very urgent thing for xapian. Any plan for this? By the way, xapian is cool and I like it. -- panjunyong