Question

A few times already, I got into situations where one of my SVN repository got corrupt and we could do anything with some versions or branches of the project without really knowing what we did. So I'm asking what can cause a repository to become corrupt?


It seems that incompatibilities between clients may cause problems, more specifically with character sets.

Was it helpful?

Solution

There are basically three distinct cases:

  1. Faulty hardware (memory, fs corruption, etc.)
  2. User's with login access to the server can corrupt repository files.
  3. Bugs in Subversion.

Faulty hardware is usually the most difficult to spot, except in the most obvious cases. Case 2 is preventable by limiting login access to the server. Everything else is a bug in Subversion. (This includes compatibility issues between client and the server.) You should never be able to corrupt the repository just by using a Subversion client (not even when there is a bug in the client, IMO).

OTHER TIPS

Potential filesystem corruption or someone mucking around with the internal svn directories?

There is always the possibility that the hardware is faulty. Things like bit errors in memory can cause silent corruption instead of simply crashing the computer; if a svn server process is the one affected, the repository can become corrupted.

If the repositories are not on the svn servers local disk, but on NFS, they can become corrupted if they're using the berkley db format. In svn 1.5 FSFS became the default for new repos - it's perfectly happy living on non-locking filesystems, like NFS.

I've had it happen a few times. SVN doesn't seem to cope well if the client goes away while the server is taking a long time to do certain things. I don't know the exact details, but I have done a few kill -9s on what I thought were read-only processes and ended up having to run a svnadmin cleanup afterwards before the server would respond again.

I had a repo corruption that took me a while to figure out. On the server I had accidentally changed the owner of the .svn dir in the repo to some unrelated user. SVN gave me corruption errors after that until I deleted and re-created the repo. Even after I corrected it. smacks forehead

This is quite common on file:// based repos, however if you have a single user / service accessing the repo, this will not happen.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top