You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Matthias Saou <th...@spam.spam.spam.spam.spam.spam.spam.egg.and.spam.freshrpms.net> on 2004/03/23 15:12:36 UTC

Catastrophic database recovery with db log files

Hi,

About the log.0000* files, the svnbook states :

"Without some sort of automatic log file removal in place, log files will
 accumulate as you use your repository. This is actually somewhat of a
 feature of the database system___you should be able to recreate your entire
 database using nothing but the log files, so these files can be useful for
 catastrophic database recovery"

Well, I've been bitten by the Fedora Core 1 db 4.1 NTPL problem, and have
a corrupt "copies" file in my repository :

# svnadmin recover /svn
Please wait; recovering the repository may take some time...
 
Recovery completed.
svn: Berkeley DB error while opening 'copies' table for filesystem /svn/db:
Invalid argument

I don't have a backup of the very latest content, but I do have all the
logfiles created ever since the repository was started, so I'd be really
interested in being able to "replay" all of those. Can anyone point me to
an explanation on how to do it?

Matthias

-- 
Clean custom Red Hat Linux rpm packages : http://freshrpms.net/
Fedora Core release 1 (Yarrow) - Linux kernel 2.6.3-2.1.253
Load : 1.57 1.02 0.89

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org


Re: Catastrophic database recovery with db log files

Posted by Ben Collins-Sussman <su...@collab.net>.
On Tue, 2004-03-23 at 10:05, Max Bowsher wrote:

> > 2. Delete the 7 tables:  nodes, revisions, representations, changes,
> > strings, transactions, uuids
> 
> Ben: Why not copies as well?

Because I'm an idiot who's unable to copy and paste text correctly.  :-)

Delete all 8 tables.



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Catastrophic database recovery with db log files

Posted by Max Bowsher <ma...@ukf.net>.
Ben Collins-Sussman wrote:
> On Tue, 2004-03-23 at 09:12, Matthias Saou wrote:
>
>> I don't have a backup of the very latest content, but I do have all the
>> logfiles created ever since the repository was started, so I'd be really
>> interested in being able to "replay" all of those. Can anyone point me to
>> an explanation on how to do it?
>
> 1. Copy your whole repository, play with the copy.
>
> 2. Delete the 7 tables:  nodes, revisions, representations, changes,
> strings, transactions, uuids

Ben: Why not copies as well?

> 3. run 'db_recover -c -h /path/to/repos/db'
>
> (The -c is for 'catastrophic' recovery.)

Matthias:
If the logs are intact, the above should work.
But, if it doesn't, it should be possible to write some code to rebuild the
copies table from data in the other tables. If it turns out to be necessary,
I'll have a go.

Max.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Catastrophic database recovery with db log files

Posted by Matthias Saou <th...@spam.spam.spam.spam.spam.spam.spam.egg.and.spam.freshrpms.net>.
Ben Collins-Sussman wrote :

> On Tue, 2004-03-23 at 09:12, Matthias Saou wrote:
> 
> > I don't have a backup of the very latest content, but I do have all the
> > logfiles created ever since the repository was started, so I'd be really
> > interested in being able to "replay" all of those. Can anyone point me to
> > an explanation on how to do it?
> 
> 1. Copy your whole repository, play with the copy.
> 
> 2. Delete the 7 tables:  nodes, revisions, representations, changes,
> strings, transactions, uuids
> 
> 3. run 'db_recover -c -h /path/to/repos/db'
> 
> (The -c is for 'catastrophic' recovery.)
> 
> I believe this is what the BDB docs recommend.

This worked perfectly, thanks a lot!
Now, although I reinstalled db 4.1 without the NPTL (posixmutexes IIRC)
stuff, I still get my repository locked and unusable after trying large
commits, which is pretty annoying. I guess I'll try to recompile against
db 4.2 instead.

Thanks again for your help, it saved quite some work :-)

Matthias

-- 
Clean custom Red Hat Linux rpm packages : http://freshrpms.net/
Fedora Core release 1 (Yarrow) - Linux kernel 2.6.3-2.1.253
Load : 0.99 0.52 0.20

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Catastrophic database recovery with db log files

Posted by Ben Collins-Sussman <su...@collab.net>.
On Tue, 2004-03-23 at 09:12, Matthias Saou wrote:

> I don't have a backup of the very latest content, but I do have all the
> logfiles created ever since the repository was started, so I'd be really
> interested in being able to "replay" all of those. Can anyone point me to
> an explanation on how to do it?

1. Copy your whole repository, play with the copy.

2. Delete the 7 tables:  nodes, revisions, representations, changes,
strings, transactions, uuids

3. run 'db_recover -c -h /path/to/repos/db'

(The -c is for 'catastrophic' recovery.)

I believe this is what the BDB docs recommend.



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org