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

Re: Proactive Question on setting up SVN repo

From: Stefan Sperling <stsp_at_elego.de>
Date: Wed, 3 Aug 2011 14:34:59 +0200

On Wed, Aug 03, 2011 at 07:56:15AM -0400, David White wrote:
> I have SVN 1.6.11 installed on a fresh install of CentOS 6 (on the Blade
> Center). I have mounted the NAS running NFS to be used as the repository
> storage location on /var/svn/. When I run "svnadmin create
> /var/svn/new-repo", it hangs for a few seconds, and then says (twice)
> "svnadmin: database is locked". However, when I go into "new-repo" and run
> ls -la, I see the subversion skeleton files.
>
> After lots of googling and brainstorming, I finally edited /etc/fstab and
> added the "nolock" option to the NFS partition when it gets mounted (and
> then these errors went away).

Do not ever run Subversion on filesystems that do not support locking.
There is a high risk of repository corruption.

You need to set up NFS file locking. In some (most?) implementations of NFS
this requires running additional daemons, e.g. rpc.statd and rpc.lockd.
Running just mountd and nfsd won't do.

Some NFS implementations do not provide file locking.
If your NFS implementation does not support locking, do not use NFS.

Note that using different NFS implementations on NFS servers and clients
can cause problems with locking. Some NFS implementations use incompatible
locking schemes -- older versions of FreeBSD cannot obtain locks from
Linux NFS servers, for instance. So I'd recommend testing the feature
before using it in production.

You can use a tool like lockf or lockfile (in the "procmail" package)
to test file locking. Test locking a file from two different NFS client
machines, and also test both the server and a client locking a file at
the same time. If that works as expected (i.e. everyone sees each
others' locks), then Subversion won't have a problem.
Received on 2011-08-03 14:35:37 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.