Friday, August 7, 2009

Subversion Berkeley DB broken, recovery failed.

Subversion Berkeley DB broken, recovery failed.

I've got a Subversion repository, backed by the berkeley DB. Occasionally it breaks down due to some locks and such not being released, but this morning it was impossible to recover it using the 'svnadmin recover' command. Instead it failed with the following error:

svnadmin: Berkeley DB error for filesystem 'db' while opening 'nodes' table:
Invalid argument
svnadmin: bdb: file nodes (meta pgno = 0) has LSN [1083][429767].
svnadmin: bdb: end of log is [1083][354707]
svnadmin: bdb: db/nodes: unexpected file type or format

I'm going to restore the repository from the last known good backup, but it would be good to know if there is a way this repository could be fixed.

edit: even the db_recover utility does not make a difference. It shows recovery is completed, but the same error persists when verifying the repository using svnadmin.
Sorry to hear that. I would suggest that at your earliest convenience, you dump that repository (svnadmin dump) and ============================================================reload it into a new one backed by FSFS (svnadmin load).

While good advice, that hardly has anything to do with the question itself. – Linor Sep 23 at 8:29
I never used a BDB repos myself, exactly because the Subversion manual warns strongly against it. So second this. – jfs Sep 23 at 8:30
I also second this - we used to have Subversion BDB repository problems. Switching to the FSFS repository type helped. – Phill Sacre Sep 23 at 8:38
have you tried db_recover? the latter tends to be able to correct more issues than svnadmin

No comments: