You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Amir Guindehi <am...@datacore.ch> on 2003/07/31 15:52:56 UTC

Re: rsync to mirror repository? svnreplicate it! ;-)

Hi all,

> If the repository is on-line, then yes, you need to follow the
> hot-backup.py algorithm:  copy the repository, *re*copy the logfiles,
> run recovery.
> 
> On svn.collab.net, we have a cron job which hot-backups the
> repository, then rsyncs the copy to another machine that gets regular
> backups.

If you would like to try a fancy method for Subversion replication, take 
a look at the 'svnreplicate' script I wrote.

It's not very well tested, but should work for small size repositories. 
It's a hook script which allows you to configure 1 master and N slave 
servers.

As long as the master is up, you can write to every server (master and 
slave), as soon as the master goes down, you have everywhere only read 
access. That's because I use the master as global lock.

It's a (N+1) Writer / N Reader schema...

The principle is simple. A write to a slave does lock the master in the 
pre-commit hook, commits and pushes the dump of that commit in the 
post-commit hook by ssh to the server, where it gets commited too and 
where from it gets pushed to the slaves before unlocking the master and 
returning. Slaves do synchronize themself on startup. As soon as 
something gets inconsistent (eg. Slave has newer revision than the 
Master), the script blocks and does nothing...

I've tested the script a bit and it works. It's only proof of concept, 
but since it works, I'm thinking about using it here in small scale 
production.

If you would like to take a look, you can find it in my Open Source 
repostory. You can find an access description at:

https://open.datacore.ch/DCwiki.open/Wiki.jsp?page=Repos.Open

To access the repository directly use:

https://open.datacore.ch/read-only/svnreplicate/trunk

There is not much documentation. You will find a small design 
description of the communication protocol.

I would be happy to hear about any success (or failure) using it... ;-))

Regards
- Amir

-- 
Amir Guindehi, nospam.amir@datacore.ch
DataCore GmbH, Witikonerstrasse 289, 8053 Zurich, Switzerland