[Xapian-discuss] Atomic DB rebuilds

Sam Liddicott sam at liddicott.com
Tue Oct 5 09:22:39 BST 2004


Samuel Liddicott wrote:

>
> Olly Betts wrote:
>
>>Do we know that?
>>
>>You can certainly create a new symlink with a temporary name, then use
>>rename() to replace the old symlink with the old one.  And according to
>>"man 2 rename":
>>
>>    If newpath already exists it will be atomically replaced (subject to a
>>    few conditions - see ERRORS below), so that there is no point at which
>>    another process attempting to access newpath will find it missing.
>>
>>Nothing in the ERRORS section seems to say that symlinks aren't replaced
>>atomically.  
>>
> You're smart.


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?

Sam
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.tartarus.org/pipermail/xapian-discuss/attachments/20041005/e039507e/attachment.htm


More information about the Xapian-discuss mailing list