What is a safe way of backing up a shared bzr repository

Matthew D. Fuller fullermd at over-yonder.net
Tue Nov 20 07:36:51 GMT 2007


On Fri, Nov 16, 2007 at 09:55:48AM -0500 I heard the voice of
Aaron Bentley, and lo! it spake thus:
> Alexander Belchenko wrote:
> > IMO, safest way is to duplicate your shared repo with branches
> > before archiving, and delete after you created tarball.
> 
> This just changes the time when concurrent updates can produce an
> inconsistent repository.  Instead of worrying about someone
> committing while you're tarring, you worry about someone committing
> while you're duplicating.

ISTM that a rather simpler and lock-free way of doing it would be just
loop rsync'ing (or some other such program) until it doesn't find any
changes to sync.  With write ordering guaranteeing that at any given
moment the repo as a whole is consistent, you're guaranteed that if no
changes are found to sync, you have a consistent copy.

Of course, it means keeping a double copy of the repo around, which
could run into disk space.  And it's not guaranteed to halt, so if you
were paranoid and had a busy repo, you'd want to add some sort of
escape hatch.  But pratically, 99+% of the time it would be done after
one loop (well, 2, counting the noop), and it'd be a pretty far-out
case with big repos and very high activity where it took more loops
than you could count on one hand (especially in the pack era, with a
lot less files to scan).


-- 
Matthew Fuller     (MF4839)   |  fullermd at over-yonder.net
Systems/Network Administrator |  http://www.over-yonder.net/~fullermd/
           On the Internet, nobody can hear you scream.



More information about the bazaar mailing list