Preliminary Suggestion For Atomic Transactions

Carson Gaspar carson+rsync at taltos.org
Wed Jan 5 19:54:41 GMT 2005


--On Thursday, January 06, 2005 02:59:44 +0800 Jeff Pitman 
<symbiont at berlios.de> wrote:

> In the past there's been a need to provide consistency between symbolic
> links or repository metadata during a sync.  Currently, rsync renames
> files piecemeal.  The attached patch (extremely ugly) attempts to
> resolve this by foregoing the rename step until the end.  It adds a new
> option (if we didn't, ls might catch up).
>
> There are several issues to get over.  The first big one in running the
> testsuite is that the parent dirs mtime is not getting preserved.  I'll
> need some insight into how this might work.  Next, hardlinks need some
> work.  Finally, there are disk space considerations by leaving all tmp
> files open until the transaction completes.  There might be security
> issues by leaving a larger timing window .. who knows, i'm sure many
> will make comments about this stuff.
>
> I give you .... (drum roll) ... atomic transactions ... (tada).  (Faces
> with perplex looks go here.)

This is _not_ atomic. Please don't call it what it isn't. The only way I 
can think of to do an actual atomic update involves renaming the top level 
directory.

-- 
Carson



More information about the rsync mailing list