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

svn_fs/svn_repo repository lock API

From: Philip Martin <philip.martin_at_wandisco.com>
Date: Wed, 08 Aug 2012 12:38:22 +0100

I've been asked about using operating system snapshots to make backups
of live repositories. These could be filesytem snapshots like ZFS or
FreeBSD's UFS2, or block level snapshots like Linux's LVM, or maybe even
a Windows shadow copy. The reasons for using snapshots, rather than
"svnadmin hotcopy", are that it's a better fit with the overall backup
strategy or that it is faster or requires less disk space or less IO.
This has also been discussed on the mailing lists, e.g.
As far as I know the snapshot method should work provided there are no
bugs in Subversion or the snapshot code but it would be good to have
more confidence that it works.

One of our customers asked about locking the FSFS write-lock file before
taking the snapshot as this would halt writes and make the repository
quiescent. It's certainly possible to do it, I wrote a program that
calls the private API svn_fs_fs__with_write_lock, but calling a private
API is a hack and I need to lock the rep-cache as well.

So I was wondering whether we should introduce a public API to do this
properly either at the svn_fs_ or svn_repos_ level. For FSFS this would
stop writes while allowing reads. A BDB implementation would probably
stop reads as well.

Certified & Supported Apache Subversion Downloads:
Received on 2012-08-08 13:39:01 CEST

This is an archived mail posted to the Subversion Dev mailing list.