[Xapian-discuss] Atomic DB rebuilds

Samuel Liddicott sam at liddicott.com
Mon Oct 4 20:35:40 BST 2004


Olly Betts wrote:

>On Mon, Oct 04, 2004 at 05:05:44PM +0100, Sam Liddicott wrote:
>  
>
>>But if I use symlinks (and I do) in /var/lib/omega/data to point to the 
>>db - well as we know, its impossible to atomically update a symlink, so 
>>I can't update another DB and then symlink to it once done.
>>    
>>
>
>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.

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


More information about the Xapian-discuss mailing list