How to make database build threaded?

Olly Betts olly at survex.com
Fri Sep 21 21:11:00 BST 2018


On Fri, Sep 21, 2018 at 05:25:27PM +0200, Franco Martelli wrote:
> just my 2 cents tips: a commit() to the database is needed before
> compact() otherwise every attempt to search fails.
> This on GNU Linux Debian 9.5 Xapian: libxapian30:amd64 1.4.3-2+deb9u1

That's a bit of an awkward case - if the compacted database lacks the
uncommitted changes that will probably catch some people by surprise,
but it doesn't seem logical for compact() to implicitly commit() either.

1.4.6 and later will actually throw an exception in this situation -
from NEWS:

| + Since 1.3.5 compacting a WritableDatabase with uncommitted changes throws
|   Xapian::InvalidOperationError when compacting to a single-file glass
|   database.  This release adds similar checks for chert and when compacting
|   to a multiple-file glass database.

Someone else ran into this in the single-file glass case, so perhaps I should
see if I can get that patch into Debian stable - it's a fairly clean patch
and solves a problem which quietly results in a broken database.

Cheers,
    Olly



More information about the Xapian-discuss mailing list