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

Dav write-through proxy on slave & svn+ssh on master question

From: Roland Cruse <roland.cruse_at_vrs-soft.com>
Date: Tue, 15 Jul 2008 15:50:04 +0200

Hello

Using subversion 1.5/WebDav on a slave and master repo I have gotten a test scenario working and I am wondering if this is a good way and I had a couple of questions if anyone has the time. Thanks so much.

In the test scenario the two repos are on the same network. But when it goes live the two will be a continent apart. The repos will be used by a couple of developers on each end. A small amount of traffic except for large commits when there are model rebuilds in the code base.

SLAVE
http://svn-slave.foo = internal, url is not seen from the outside, accessed by ssh. Developers check out from here.
    hooks/{pre-revprop-change,start-commit} check only user "svnsync" is allowed.
        Apache (proxy enabled):
        <Location /foo>
        DAV svn
        SVNPath /home/svnsync/repos/slave
        SVNMasterURI http://svn-master.bar/bar
        </Location>
MASTER
http://svn-master.bar = external url, accessed by ssh and url. Developers also check out from here. Is this okay? Why have another slave when the master can be used as a repo...right? Can anyone think of why not? Thanks.
    hooks/
        post-commit:
            svnsync sync --username svnsync svn+ssh://svnsync@svn-slave.foo/home/svnsync/repos/slave &
        post-revprop-change:
            REVISION=${2}
            /usr/local/bin/svnsync copy-revprops --username svnsync svn+ssh://svnsync@svn-slave.foo/home/svnsync/repos/slave ${REVISION} &

Initialzie the slave from the master:
    svnsync init --username svnsync svn+ssh://svnsync@svn-slave.foo/home/svnsync/repos/slave file:///svn/repos/test/master/
Syncronize the slave from the master:
    svnsync sync --username svnsync svn+ssh://svnsync@svn-slave.foo/home/svnsync/repos/slave

Permissions and ssh keys set accordingly..

Success: working copies from slave and master reflect commits and updates from both working copies of slave and master.

What has me a little worried is this bit in the red-bean book about "infinite recursion":
...
Next, we need to deal with the problem of infinite recursion. With the current configuration, imagine what will happen when a Subversion client performs a commit to the master server. After the commit completes, the server uses svnsync to replicate the new revision to each slave. But because svnsync appears to be just another Subversion client performing a commit, the slave will immediately attempt to proxy the incoming write request back to the master! Hilarity ensues.
...

The solution the bean books gives is to have another <Location /foo-only-for-master> directive on the slave, which points to the same directory as the already defined slave repo, for the master to write to. In the senario above, it seems, svn+ssh can only sync to the one file location. Seeing as though it is not using a url whos location can be abstracted by apache. Is my scenario in danger of "infinite recursion"?

Any thoughts?
Roland
Received on 2008-07-15 15:55:27 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.