Recovering BDB SVN repository 'revisions' DB
653065Aug 1 2008 — edited Aug 1 2008Hi there,
My server crashed the other day and I've been trying to recover the SVN repository with a BDB back-end. The db_verify utility reports that the files in the svnroot/db directory are all fine, with the exception of the 'revisions' DB.
When running db_verify on this file, the following message is reported:
$ /usr/local/BerkeleyDB.4.6/bin/db_verify ~/svnroot/db/revisions
db_verify: Page 5: btree or recno page is of inappropriate type 0
db_verify: Page 5: totally zeroed page
db_verify: Page 5: record count incorrect: actual 0, in record 225
db_verify: Page 6: btree or recno page is of inappropriate type 0
db_verify: Page 6: totally zeroed page
db_verify: Page 6: record count incorrect: actual 0, in record 225
db_verify: Page 7: btree or recno page is of inappropriate type 0
db_verify: Page 7: totally zeroed page
db_verify: Page 7: record count incorrect: actual 0, in record 132
db_verify: Page 1: bad record count: has 602 records, claims 1184
db_verify: Page 4: unterminated leaf chain
db_verify: /home/guyverm/svnroot/db/revisions: DB_VERIFY_BAD: Database verification failed
However, when running a db_dump, you get more information, particularly the "File handles still open at environment close" line:
$ /usr/local/BerkeleyDB.4.6/bin/db_dump -f ~/bdb.dump ~/svnroot/db/revisions
db_dump: page 0: illegal page type or format
db_dump: PANIC: Invalid argument
db_dump: PANIC: fatal region error detected; run recovery
db_dump: close: DB_RUNRECOVERY: Fatal error, run database recovery
db_dump: File handles still open at environment close
db_dump: Open file handle: /home/guyverm/svnroot/db/revisions
db_dump: PANIC: fatal region error detected; run recovery
db_dump: dbenv->close: DB_RUNRECOVERY: Fatal error, run database recovery
I was wondering if anyone can advise whether it is possible to recover from this particular error, and if so, how I would do so.
Regards
Michael