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

Re: Help Needed regarding svn master-slave configuration

From: Nico Kadel-Garcia <nkadel_at_gmail.com>
Date: Wed, 10 Aug 2011 05:15:12 -0400

On Wed, Aug 10, 2011 at 3:40 AM, Ulrich Eckhardt
<ulrich.eckhardt_at_dominolaser.com> wrote:
> On Wednesday 10 August 2011, Sharma, Gaurav wrote:
>> I have a task in hand to setup a master-slave svn repository configuration
>> so that master will synchronize its repositories with slave. I searched a
>> lot on web and found many links telling about how to set it up. Following
>> those links I started using "svnsync" for this purpose. But some how after
>> spending many days I am not able it to work as desired.
> [...]
>> I have two objectives for this setup-
>>
>> 1-       End user should be able to perform both check-out and check-in to
>> the slave repository.
>> 2-       Master should synchronize all its repository with slave
>
>
> There are basically three steps involved with this:
> 1. set up a secondary repository
> This involves creating it and initialising it with svnsync. After this step,
> you should be able to pull changes from the primary repository by invoking
> svnsync locally.
> 2. provide access to the secondary repository
> This then allows you to push (as opposed to pull) changes from the primary to
> the secondary repository. Further, it allows you to check out from the
> secondary repository. You should disallow checkins and revprop changes except
> for the dedicated svnsync user though, as documented. This seems to be set up
> correctly already.
> 3. connect the repositories
> This involves creating a post-commit hook that svnsyncs the changes to the
> secondary repository and one for the rev-prop changes, but you seem to have
> these set up already.
> 4. create a transparent write-proxy
> This requires Apache (the rest could be dove with svnserve, too) and should
> also be documented. I never made this step though but only the former three,
> since the write-proxy wasn't my requirement.

Step 3 and 4 *are not enough*. The synchronization would have to occur
at the "commit" stage, not the "post-commit", because "commit" has to
be atomic with Subversion. Post-commit is nominally allowed to fail
without stopping the commit operation. And the only support I've seen
for that sort of thing is in Wandisco's "Multi-Site" tool.

If you use the post-commit approach, as soon as people send distinct
commits at the same time to the different repositories, and each of
them completes before performing a post-commit operation, of if one
repository is disconnected for a while for whatever network or downed
server reason and gets a commit that is not successfully transmitted
ot the other repository, then the other repository receives a local
commit before it can perform an svnsync syccessfully, the same
revision number will have different contents in each repository and
you are *screwed* trying to match them ever again.

This way lies madness.
Received on 2011-08-10 11:16:03 CEST

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.