[Xapian-discuss] Perl XS bindings, postlist_begin

Olly Betts olly@survex.com
Fri, 28 May 2004 15:16:10 +0100


On Fri, May 28, 2004 at 02:59:51PM +0100, Francis Irving wrote:
> Something bad is happening, but I don't quite understand why.
> Exception: Db block overwritten at ./index.pl line 68, <F> line 2002.

This isn't bad.

Xapian supports multiple readers and one writer concurrently.  But if
the writer commits two or more batches of changes, a reader will get
this exception.  The issue is that a reader needs a consistent snapshot
of the database - for the usual model of searching while indexing, it's
usually enough to keep one old version around.

If you get that exception, you can just call "reopen" on the reader to
reopen it at the latest revision, and repeat the operation(s) you were
doing.

That error message ought to be reworded to explain better what's
actually happened and point to reopen().

> I shouldn't be reading anything which has been written to in the 
> same batch.

It'll probably be a branch block in the Btree, rather a particular leaf
block.

Cheers,
    Olly