[Xapian-discuss] Atomic DB rebuilds

Sam Liddicott sam at liddicott.com
Tue Oct 5 13:32:32 BST 2004


Richard Boulton wrote:

>I think there is.  Possibly this could be solved by using readlink(2) to
>read the actual path pointed to by the symlink, and constructing the
>database path based on the real path.
>
>  
>

Actually even using readlink or chdir to the right place is subject to 
the race condition of the new db being in place and the old one 
recursive deleted while a xapian instance is still in the process of 
opening it.

So I must guarantee to leave the old copy around for at least a short 
while after mv'ing the symlink to the new one.

Sam



More information about the Xapian-discuss mailing list