[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: db broken, recover and dump fails

From: Max Bowsher <maxb_at_ukf.net>
Date: 2005-05-09 22:46:12 CEST

Henrik Frisk wrote:
> Max Bowsher <maxb@ukf.net> wrote:
>
>> Henrik Frisk wrote:
>>> Hi,
>>>
>>> After a power failure (I think that's what caused the problems to begin
>>> with) my repository got corrupt. I can do recover and check out
>>> files but I
>>> cannot commit. I have searched for info and I have tried many different
>>> methods. After doing a recovery, I can't even do a dump; It stops at
>>> revision 2, takes for ever, and than prints a million lines such as:
>>>
>>> svn: bdb: DB_ENV->log_flush: LSN of 118/920926 past current end-of-log
>>> of
>>> 1/2750
>>> svn: bdb: Database environment corrupt; the wrong log files may have
>>> been
>>> removed or incompatible database files imported from another
>>> environment.
>>>
>>> What I have been going through seems similar to what Dean Iverson
>>> described
>>> in this post:
>>> http://subversion.tigris.org/servlets/ReadMsg?list=users&msgNo=30379,
>>> but I
>>> can't seem to find any replies.
>>>
>>> I have tried removing log and __db files and doing db_recover but
>>> nothing
>>> helps. Recovery exits normally but the problems remain (unable to
>>> commit -
>>> repository broken after I try).
>>
>> cd path/to/my_old_repository
>> cd ..
>> svnadmin create --fs-type=bdb a_new_repository
>> cd a_new_repository/db
>> rm *s __db.* log.*
>> cd ../../my_old_repository/db
>> for i in *s; do
>> db_dump -r "$i" | db_load -h ../../a_new_repository/db "$i"
>> done
>> cd ../..
>> svnadmin recover a_new_repository
>> svnadmin verify a_new_repository
>>
>> If that doesn't work, tarball your old repository and put it somewhere
>> I can examine it.
>>
>> Max.
>
> This is what I get in the end:
>
> svnadmin verify subv
> svn: Corrupt DB: revision 0 missing from 'revisions' table, in filesystem
> 'subv/db'
>
> At least, that's a message i haven't seen before :). Is there's something
> I
> can do to fix that? db_recover doesn't work and svnadmin recover doesn't
> work. I put my repository up at
> http://www.henrikfrisk.com/documents/repos.tar.gz

Drat, I forgot about that bug in BDB 4.2's db_dump.

If you haven't deleted a_new_repository, then run the procedure below:

cd path/to/my_old_repository
cd ..

for i in revisions uuids; do
  db_dump -r "$i" | egrep -v '^keys=1$' | db_load -h
../../a_new_repository/db "$i"
done

cd ../..
svnadmin recover a_new_repository
svnadmin verify a_new_repository

If you have deleted a_new_repository, then the *full* procedure would be:

cd path/to/my_old_repository
cd ..
svnadmin create --fs-type=bdb a_new_repository
cd a_new_repository/db
rm *s __db.* log.*
cd ../../my_old_repository/db
for i in changes copies nodes representations strings transactions; do
  db_dump -r "$i" | db_load -h ../../a_new_repository/db "$i"
done
for i in revisions uuids; do
  db_dump -r "$i" | egrep -v '^keys=1$' | db_load -h
../../a_new_repository/db "$i"
done
cd ../..
svnadmin recover a_new_repository
svnadmin verify a_new_repository

Max.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Mon May 9 22:49:30 2005

This is an archived mail posted to the Subversion Users mailing list.