[Xapian-discuss] Atomic DB rebuilds

Olly Betts olly at survex.com
Tue Oct 5 13:05:18 BST 2004


On Tue, Oct 05, 2004 at 10:43:24AM +0100, Sam Liddicott wrote:
> dbi2omega blah | \
> scriptindex --overwrite $newdb cetoptics.si /dev/fd/0 && \
> ln -s $newdb $newdb.lnk && perl -e "rename '$newdb.lnk', '$DBLINK';" && 
> rm -fr "$olddb"

Erm, scriptindex will look for input on stdin if you don't specify a
"dump" file on the command line.  So you can just remove the
"/dev/fd/0".

> Does omega chdir to the database dir before opening all the files? Or is 
> there a race condition as the symlink changes if a DB is being opened?

You're right, there's a race there currently.  But you're also right in
suggesting that it's easily solved by chdir() to the database directory.
That will also simplify path handling actually.

Cheers,
    Olly



More information about the Xapian-discuss mailing list