[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Discrepancies in svn mirror created with svnsync

From: Andreas Mohr <andi_at_lisas.de>
Date: Sat, 9 Feb 2013 11:31:07 +0100

Hi,

On Fri, Feb 08, 2013 at 03:45:29PM +0100, Stefan Sperling wrote:
> I cannot tell you what happened here and why the revisions in the
> mirro are empty. That sure is concerning.
>
> However there are known race conditions in svnsync in Subversion 1.6.
> See http://subversion.apache.org/docs/release-notes/1.7.html#atomic-revprops
>
> So you should definitely wrap svnsync in a tool like lockfile (part of
> procmail), or upgrade to 1.7.

Note that directory creation/removal are the only FS mechanism which is
guaranteed to be atomic, on UNIX (POSIX?) at least.
Thus if lockfile isn't available/installable, as a manual mechanism
you could fetch a tempfile name (obviously to be globally used by *all*
svnsync script users!), and use that name to create a directory,
run svnsync on success and then remove it.
(or probably better use a static GUID value in the directory name)

Be careful about "solutions" other than lockfile - some of these appear to be
terribly unsafe (some newer Ubuntu-introduced "atomic locking" package
comes to mind - which then executes anyway after a measly timeout!).

Andreas Mohr
Received on 2013-02-09 11:31:46 CET

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.