You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Vincent Lefevre <vi...@vinc17.net> on 2010/08/10 17:21:50 UTC

repository corruption by "svnadmin upgrade"

I've posted messages about the following problem in the users list,
but here's other information.

After a "svnadmin upgrade" with svn version 1.5.1 (r32289), which
terminated without any error, and svn-populate-node-origins-index,
the repository got corrupted:

/svnroot/mpfr/db/format now contains:

3
layout linear

without an ending \n, while the documentation[*] says:

The format file is a single line of the form "<format number>\n",
followed by any number of lines specifying 'format options' -
additional information about the filesystem's format.  Each format
option line is of the form "<option>\n" or "<option> <parameters>\n".

The "current" file hasn't been updated to the new format; it is
still in the format 2 (with the old timestamp). According to the
documentation:

The format of the "current" file is:

 * Format 3 and above: a single line of the form
   "<youngest-revision>\n" giving the youngest revision for the
   repository.

 * Format 2 and below: a single line of the form "<youngest-revision>
   <next-node-id> <next-copy-id>\n" giving the youngest revision, the
   next unique node-ID, and the next unique copy-ID for the
   repository.

[*] http://svn.apache.org/repos/asf/subversion/trunk/subversion/libsvn_fs_fs/structure

The following files/directory have been created:

-rw-r--r-- 1 www-data scm_mpfr      2 2010-08-06 16:01:43 txn-current
-rw-r--r-- 1 www-data scm_mpfr      0 2010-08-06 16:01:43 txn-current-lock
drwxr-sr-x 2 www-data scm_mpfr   4096 2010-08-06 16:01:43 txn-protorevs

and they prevent any commit (due to the lock, I assume).

The contents themselves are correct (tested with "svnadmin verify" and
a dump comparison).

More information about the repository:

vlefevre@ff-scm-prod:~$ svnadmin lslocks /svnroot/mpfr
vlefevre@ff-scm-prod:~$ svnadmin lstxns /svnroot/mpfr
vlefevre@ff-scm-prod:~$ export TIME_STYLE="+%Y-%m-%d %H:%M:%S"
vlefevre@ff-scm-prod:~$ ls -l /svnroot/mpfr
total 24
-rw-r--r-- 1 www-data scm_mpfr  379 2005-10-24 14:03:46 README.txt
drwxrwsr-x 2 www-data scm_mpfr 4096 2005-10-24 14:03:46 conf
drwxrwsr-x 2 www-data scm_mpfr 4096 2008-12-10 18:44:36 dav
drwxrwsr-x 7 www-data scm_mpfr 4096 2010-08-06 16:01:43 db
-r--r--r-- 1 www-data scm_mpfr    2 2010-08-06 16:01:43 format
drwxrwsr-x 2 www-data scm_mpfr 4096 2010-05-25 14:47:14 hooks
drwxrwsr-x 2 www-data scm_mpfr 4096 2005-10-24 14:03:46 locks
vlefevre@ff-scm-prod:~$ ls -l /svnroot/mpfr/db
total 468
-rw-rw-r-- 1 www-data scm_mpfr     11 2010-08-05 02:26:05 current
-r--r--r-- 1 www-data scm_mpfr     15 2010-08-06 16:01:43 format
-rw-r--r-- 1 www-data scm_mpfr      5 2005-10-24 14:03:46 fs-type
drwxrwsr-x 2 www-data scm_mpfr   4096 2010-08-06 16:02:20 node-origins
drwxrwsr-x 2 www-data scm_mpfr 229376 2010-08-05 02:26:05 revprops
drwxrwsr-x 2 www-data scm_mpfr 229376 2010-08-05 02:26:05 revs
drwxrwsr-x 2 www-data scm_mpfr   4096 2010-08-05 02:26:05 transactions
-rw-r--r-- 1 www-data scm_mpfr      2 2010-08-06 16:01:43 txn-current
-rw-r--r-- 1 www-data scm_mpfr      0 2010-08-06 16:01:43 txn-current-lock
drwxr-sr-x 2 www-data scm_mpfr   4096 2010-08-06 16:01:43 txn-protorevs
-rw-r--r-- 1 www-data scm_mpfr     37 2005-10-24 14:03:46 uuid
-rw-rw-r-- 1 www-data scm_mpfr      0 2005-10-24 14:03:46 write-lock
vlefevre@ff-scm-prod:~$ ls -l /svnroot/mpfr/db/transactions
total 0
vlefevre@ff-scm-prod:~$ ls -l /svnroot/mpfr/db/txn-protorevs
total 0
vlefevre@ff-scm-prod:~$ ls -l /svnroot/mpfr/locks
total 8
-rw-r--r-- 1 www-data scm_mpfr 295 2005-10-24 14:03:46 db-logs.lock
-rw-r--r-- 1 www-data scm_mpfr 460 2005-10-24 14:03:46 db.lock
vlefevre@ff-scm-prod:~$ cat /svnroot/mpfr/format
5
vlefevre@ff-scm-prod:~$ cat /svnroot/mpfr/db/current
7052 un bv
vlefevre@ff-scm-prod:~$ cat /svnroot/mpfr/db/format; echo
3
layout linear
vlefevre@ff-scm-prod:~$ cat /svnroot/mpfr/db/fs-type
fsfs

-- 
Vincent Lefèvre <vi...@vinc17.net> - Web: <http://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / Arénaire project (LIP, ENS-Lyon)

Re: repository corruption by "svnadmin upgrade"

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
Vincent Lefevre wrote on Tue, Aug 10, 2010 at 17:21:50 +0200:
> I've posted messages about the following problem in the users list,
> but here's other information.
> 
> After a "svnadmin upgrade" with svn version 1.5.1 (r32289), which
> terminated without any error, and svn-populate-node-origins-index,
> the repository got corrupted:
> 
> /svnroot/mpfr/db/format now contains:
> 
> 3
> layout linear
> 
> without an ending \n

Fixed in <https://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c?r1=874539&r2=874540&>

The fix is also in 1.6.x/.