Return-Path: X-Original-To: apmail-subversion-users-archive@minotaur.apache.org Delivered-To: apmail-subversion-users-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id AA2C2CE62 for ; Tue, 14 Aug 2012 02:11:31 +0000 (UTC) Received: (qmail 96679 invoked by uid 500); 14 Aug 2012 02:11:31 -0000 Delivered-To: apmail-subversion-users-archive@subversion.apache.org Received: (qmail 96637 invoked by uid 500); 14 Aug 2012 02:11:31 -0000 Mailing-List: contact users-help@subversion.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list users@subversion.apache.org Received: (qmail 96629 invoked by uid 99); 14 Aug 2012 02:11:30 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Aug 2012 02:11:30 +0000 X-ASF-Spam-Status: No, hits=-5.0 required=5.0 tests=RCVD_IN_DNSWL_HI,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of trent.fisher@oracle.com designates 148.87.113.117 as permitted sender) Received: from [148.87.113.117] (HELO rcsinet15.oracle.com) (148.87.113.117) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Aug 2012 02:11:21 +0000 Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94]) by rcsinet15.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id q7E2Axc1019912 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 14 Aug 2012 02:11:00 GMT Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157]) by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id q7E2AxI1008107 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 14 Aug 2012 02:10:59 GMT Received: from abhmt110.oracle.com (abhmt110.oracle.com [141.146.116.62]) by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id q7E2AwKT025247 for ; Mon, 13 Aug 2012 21:10:59 -0500 Received: from [10.154.117.3] (/10.154.117.3) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 13 Aug 2012 19:10:58 -0700 Message-ID: <5029B3B1.3090008@oracle.com> Date: Mon, 13 Aug 2012 22:10:57 -0400 From: Trent Fisher User-Agent: Mozilla/5.0 (X11; Linux i686; rv:14.0) Gecko/20120714 Thunderbird/14.0 MIME-Version: 1.0 To: users@subversion.apache.org Subject: Re: Repairing or removing broken revisions References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Source-IP: ucsinet22.oracle.com [156.151.31.94] X-Virus-Checked: Checked by ClamAV on apache.org On 08/01/2012 10:49 AM, Johan Corveleyn wrote: > On Wed, Aug 1, 2012 at 2:24 PM, Joachim Sauer wrote: >> Hello, >> >> I'm currently reworking backups of multiple SVN repositories. In the >> process I found out that one of those repositories has three broken >> revisions. The problem is that the revision files in the revs >> directory for those 3 revisions are of size 0 (those contain the >> actual data of the revision, as far as I understand). This means that >> I can't use svn dump (as it stops at that broken revision) and I can't >> use svnsync. >> >> For the backup itself I can still use svn hotcopy (the previous way of >> doing a backup), so this will be my workaround. >> >> I was able to find out the affected paths in the repository and >> luckily the latest revision of those paths can be checked out without >> a problem (so we "only" lost history, not current data). >> >> But a broken repository is not desirable and I should attempt to fix >> it as much as possible. Losing the information of those three >> revisions (and a few related ones, probably) would not be a major >> problem, but the repository as a whole should be in a consistent state >> (to allow svnadmin dump to work, for example). >> >> Is there a way to remove the broken revisions and still keep the rest >> of the repository intact? Ideally without requiring everyone to make >> new clean checkouts because the repository became incompatible. >> >> regards >> Joachim Sauer >> >> P.S.: unfortunately there are no working backups of the broken >> revisions, as the corruption seems to be pretty old (older than our >> last full backup). > Since you know the affected paths, I think one possible way is to do > an svnsync, while excluding the "corrupted paths" by way of path-based > authz (i.e. make the affected paths unreadable by the svnsync user, > using an authz file on the source repository). After that, re-import > the "corrupted files" from one of your working copies. > > I think everyone will have to re-checkout though, because you'll have > a new repository with slightly altered history. So it wouldn't be safe > to give this new repository the same repos-uuid, and act like it's the > same. > > If you search the mailinglist archives, you might find some more posts > about this svnsync recovery trick (excluding broken files). > I had a similar situation, though I only had one damaged revision. I did a dump in three segments, up to the bad rev, the bad rev and the remaining revs, something like this (assuming rev 44445 is the bad one): svnadmin dump -r0:44444 /some/repos > p1 svnadmin dump --incremental -r44445 /some/repos > p2 svnadmin dump --incremental -r44446:HEAD /some/repos > p3 Then I manually doctored p2 to indicate that the rev is broken (but leave the original comment intact), then load all three into a fresh repository (cat p1 p2 p3 | svnadmin load /some/new/repos) The advantage of this is that the uuid and rev numbers remain the same, so existing workspaces will work. And this would preserve all other history of the given file. I just did this on a production repository two weeks ago, and no complaints so far. trent...