You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by David White <dw...@gmail.com> on 2011/08/03 13:56:15 UTC

Proactive Question on setting up SVN repo

We have a Blade Center downstairs with a NAS mounted to it for additional
storage. I'm in the process of setting up a SVN server for folks in our
company umbrella to use. My boss wants a folder on the NAS to be used as the
repo storage location, due to the extra space and redundancy we have on it.
Thus...

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).

I do understand folks' hesitation to use a network file system as the
location for repositories. I have hidden the folder on the NAS, and have set
permissions appropriately so only the authorized people (who know that
messing with SVN repo files manually can royally screw everything up). All
of this aside....

Do you forsee problems with the NAS being mounted with the "nolock" option?
In /etc/fstab, the line looks like this:

{private-ip}:/volume1/svn     /var/svn     nfs     nolock     0 0

My guess is, if you get two people trying to do commits at the same time
(which is unlikely right now, but as we grow, could become more possible),
things could get corrupted. So, how worried should I be about this? If it's
going to cause royal pains in the future, how would you suggest I fix the
"database is locked" error message when the nolock isn't enabled on the
mount?

-- 
- David White -
Smooth Stone Services
Computer Technical Support, IT Services, & Web Hosting Solutions
http://www.smoothstoneservices.com

Re: Proactive Question on setting up SVN repo

Posted by Stefan Sperling <st...@elego.de>.
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.

RE: Proactive Question on setting up SVN repo

Posted by Brenden Walker <BK...@drbsystems.com>.
Can you install SVN on the NAS?  I'm running a QNAP NAS at home with subversion on it.

Just an idea.


From: David White [mailto:dwrudy@gmail.com]
Sent: Wednesday, August 03, 2011 7:56 AM
To: users@subversion.apache.org
Subject: Proactive Question on setting up SVN repo

We have a Blade Center downstairs with a NAS mounted to it for additional storage. I'm in the process of setting up a SVN server for folks in our company umbrella to use. My boss wants a folder on the NAS to be used as the repo storage location, due to the extra space and redundancy we have on it. Thus...

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).

I do understand folks' hesitation to use a network file system as the location for repositories. I have hidden the folder on the NAS, and have set permissions appropriately so only the authorized people (who know that messing with SVN repo files manually can royally screw everything up). All of this aside....

Do you forsee problems with the NAS being mounted with the "nolock" option? In /etc/fstab, the line looks like this:

{private-ip}:/volume1/svn     /var/svn     nfs     nolock     0 0

My guess is, if you get two people trying to do commits at the same time (which is unlikely right now, but as we grow, could become more possible), things could get corrupted. So, how worried should I be about this? If it's going to cause royal pains in the future, how would you suggest I fix the "database is locked" error message when the nolock isn't enabled on the mount?

--
- David White -
Smooth Stone Services
Computer Technical Support, IT Services, & Web Hosting Solutions
http://www.smoothstoneservices.com

Re: Proactive Question on setting up SVN repo

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
That message probably comes from SQLite.

SQLite uses the same locks FSFS uses internally.

FSFS depends on locks to ensure consistency with multiple writers.

FSFS does not guarantee correctness without locks.  (Concretely:
without locks, if you run 'svnadmin pack' twice concurrently, you can
lose a shard of data.  If you run two commits concurrently, you can
pretty easily have both of them succeed and claim to be r42 (and then
one of your developers needs to rm -rf a working copy).)

Does that spell "Don't do that"?


David White wrote on Wed, Aug 03, 2011 at 07:56:15 -0400:
> We have a Blade Center downstairs with a NAS mounted to it for additional
> storage. I'm in the process of setting up a SVN server for folks in our
> company umbrella to use. My boss wants a folder on the NAS to be used as the
> repo storage location, due to the extra space and redundancy we have on it.
> Thus...
> 
> 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).
> 
> I do understand folks' hesitation to use a network file system as the
> location for repositories. I have hidden the folder on the NAS, and have set
> permissions appropriately so only the authorized people (who know that
> messing with SVN repo files manually can royally screw everything up). All
> of this aside....
> 
> Do you forsee problems with the NAS being mounted with the "nolock" option?
> In /etc/fstab, the line looks like this:
> 
> {private-ip}:/volume1/svn     /var/svn     nfs     nolock     0 0
> 
> My guess is, if you get two people trying to do commits at the same time
> (which is unlikely right now, but as we grow, could become more possible),
> things could get corrupted. So, how worried should I be about this? If it's
> going to cause royal pains in the future, how would you suggest I fix the
> "database is locked" error message when the nolock isn't enabled on the
> mount?
> 
> -- 
> - David White -
> Smooth Stone Services
> Computer Technical Support, IT Services, & Web Hosting Solutions
> http://www.smoothstoneservices.com