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

Re: Corrupted revisions - need help

From: Stefan Sperling <stsp_at_elego.de>
Date: Mon, 19 Nov 2012 21:07:59 +0100

On Mon, Nov 19, 2012 at 04:11:01PM +0200, Gunther Mayer wrote:
> So, I'm wondering if anyone from the community can help me. I think
> I still have all of the original files which got written or amended
> during the three broken revisions (in one or more working copies),
> but one of these revisions is about 1.5GB so sharing is a bit tricky
> (the other two are 23MB and 1.7MB). I'm even willing to pay somebody
> to do the job if that's what's necessary, I only want to recreate my
> repository from scratch as a LAST resort as I would lose all of my
> history.

I've dealt with similar corruption problems in the past, where original
fulltext file content was still available.

So maybe this hint will help you: You might be able to create good
representations by committing the fulltext files to a fresh temporary
repository, possibly in multiple commits in the right order if you have
more than one version of a file available.

Extract these reps from the FSFS data of the temporary repository and
stitch them into the broken repository at appropriate places, recalculating
checksums where necessary, and tweaking offsets and maybe adding some padding
if necessary. In case the good reps use less space than the bad ones, or
the exact same amount, they can be made to work fairly easily.
If they end up being larger things gets a bit more tricky. Note that
due to the way FSFS revisions are parsed by Subversion (it looks at the
end of the file for the changed-path data section offset first) you can
move the changed-path data section further down to create more space in
an existing revision file -- but you cannot move any other existing sections
by even a single bit!

I've managed to fix several corrupt revisions like this. There was a similar
problem at the time, an elego customer's the SVN server was running in a VM
and when the host computer unexpectedly lost power revision data in several
FSFS files didn't get saved to the physical disks on time... oops!
They were able to get some fulltext files from working copies which we could
use to recreate some of the lost reps.

Some related reading material (read in given order):
https://svn.apache.org/repos/asf/subversion/trunk/subversion/libsvn_fs_base/notes/fs-history
https://svn.apache.org/repos/asf/subversion/trunk/subversion/libsvn_fs_fs/structure

Good luck!
Received on 2012-11-19 21:08:48 CET

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.