All,
I'm implementing an SVN repository with a failover on a sibling server
(100mbs LAN), built to do failover very very quickly (two identically
configured SVN services, with load balancer directing traffic at the
primary.)
Backup repo would be seeded with an svnadmin hotcopy. Also can assume that
revprops would never ever change for old revs.
My plan for a script to keep the secondary in 'hot' backup state is
basically (pseudocode):
copy \\server-1\svn\repoA\db\current
\\server-2\svn\repoA\db\current.tmp
primary_youngest = svnlook \\server-1\svn\repoA
secondary_youngest = svnlook \\server-2\svn\repoA
syncrev = secondary_youngest + 1
while(syncrev <= primary_youngest)
{
copy \\server-1\svn\repoA\db\revs\{{syncrev}}
\\server-2\svn\repoA\db\revs\{{syncrev}}
copy \\server-1\svn\repoA\db\revprops\{{syncrev}}
\\server-2\svn\repoA\db\revprops\{{syncrev}}
}
copy \\server-2\svn\repoA\db\current.tmp current /Y (avoid prompting)
This would be run very frequently so would never pick up more than a few
revs at a time. Is this reasonably correct? esp wrt to getting a copy of
"current" prior to initiating rev-by-rev copy -- so 'current' file updated
is the one that happened before we copied te rev data over.
If the primary failed, the traffic would be routed to secondary
immediately. When bringing the primary back online, this sync would be run
in reverse, then traffic routed to primary again.
Any thoughts? Anyone else doing something similar?
Thanks,
Kyle
Received on Tue Oct 17 04:50:28 2006