Svn – Best way to create an SVN-Mirror

svn

I am currently looking into the best way to set up an SVN mirror. I currently see three possibilities all with their own drawbacks:

  • Have an SVN post-commit-Hook that is blocking and syncing via svnsync. The problem here is obviously, that the commit is blocking until the data is transfered to the mirror.
  • Have an SVN post-commit-Hook that is non-blocking and syncing via svnsync. Here I see the following, more subtle problem: Imagine someone checks in a BIG file, and someone else shortly after that checks in a small file. Because the commit is non-blocking, two svnsync processes could be running at the same time and the small file could overtake the BIG file on the way to the mirror (this seems very time-critical and unlikely, although possible in principle). Their revision would swap.
  • Sync like every fifteen minutes with a cron-job. Same problem if a commit takes longer than 15 minutes and obviously that time-delay.

Did I forget a possibility? Did I get something wrong? Any ideas? Thank you already!

Maybe I should note that the second possibility is the one suggested by different web-sites. E.g. see
http://www.kirkdesigns.co.uk/mirror-svn-repository-svnsync

Best Answer

You could try an approach similar to the one we use at Atlassian

https://www.atlassian.com/blog/archives/subversion_replication_at_atla?_ga=2.217251286.1933127788.1517539727-1159165484.1517539727

disclaimer: I am currently an Atlassian employee, but was not involved in implementing this solution (only maintaining it)

As I said above in the comment, svnsync, run from a remote repository behaves deterministically. It cannot apply changesets out of order. So the only problem you have using a remote repository is the amount of lag due to changeset propagation.

Related Topic