Loki
Loki

Reputation: 30960

How can a SVN repository become corrupt?

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.

Upvotes: 15

Views: 9730

Answers (7)

PostMan
PostMan

Reputation: 6977

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

Upvotes: 0

thekbb
thekbb

Reputation: 7924

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.

Upvotes: 2

DeviousBlue
DeviousBlue

Reputation: 241

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

Upvotes: 0

JesperE
JesperE

Reputation: 64434

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

Upvotes: 12

CesarB
CesarB

Reputation: 45575

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.

Upvotes: 3

user42092
user42092

Reputation:

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.

Upvotes: 0

grepsedawk
grepsedawk

Reputation: 6059

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

Upvotes: 4

Related Questions