You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Daniel Shahaf <d....@daniel.shahaf.name> on 2008/12/27 13:39:01 UTC
packing causes 'svnadmin verify' to fail
Summary: 'svnadmin pack' can bring the repository to a state where
'svnadmin verify' fails.
I can reproduce it with the svn repository, I couldn't find how to
reproduce it in a Greek tree repository.
Reproduction script:
@echo off
cd \tmp\svn
echo @@@ Versions
svn --version | head -2
svnsync --version | head -2
svnadmin --version | head -2
echo @@@ Recreate the repository
rd/s/q r
svnadmin create r
touch r\hooks\pre-revprop-change.bat
echo @@@ Set small shards (so packing has an effect)
### Couldn't get perl to maintain EOL style.
vim -Nneu NONE -i NONE -b -c "set noreadonly | 2s/sharded 1000/sharded 4/ | wq!" r\db\format
echo @@@ Hack. Force the sync to abort after syncing r9.
mkdir r\db\revprops\2\10
echo @@@ Sync.
svnsync init file:///tmp/svn/r http://svn.collab.net/repos/svn
svnsync sync file:///tmp/svn/r
echo @@@ The above error was expected.
echo @@@ This will work:
svnadmin verify -r2 r
echo @@@ Packing...
svnadmin pack r
echo @@@ This will fail:
svnadmin verify -r2 r
Output:
@@@ Versions
svn, version 1.6.0 (dev build-r34949)
compiled Dec 27 2008, 00:28:10
svnsync, version 1.6.0 (dev build-r34949)
compiled Dec 27 2008, 00:28:10
svnadmin, version 1.6.0 (dev build-r34949)
compiled Dec 27 2008, 00:28:10
### I actually used r34952; the output is wrong.
@@@ Recreate the repository
@@@ Set small shards (so packing has an effect)
@@@ Hack. Force the sync to abort after syncing r9.
@@@ Sync.
Copied properties for revision 0.
Transmitting file data .........................................................
................................................................................
................................................................................
................................................................................
................................................................................
................................................................................
.........................................................
Committed revision 1.
Copied properties for revision 1.
Transmitting file data .
Committed revision 2.
Copied properties for revision 2.
Transmitting file data .
Committed revision 3.
Copied properties for revision 3.
Transmitting file data .
Committed revision 4.
Copied properties for revision 4.
Transmitting file data .
Committed revision 5.
Copied properties for revision 5.
Transmitting file data .
Committed revision 6.
Copied properties for revision 6.
Transmitting file data .
Committed revision 7.
Copied properties for revision 7.
Transmitting file data .
Committed revision 8.
Copied properties for revision 8.
Transmitting file data .
Committed revision 9.
Copied properties for revision 9.
Transmitting file data .
..\..\..\subversion\libsvn_subr\io.c:2900: (apr_err=720005)
svnsync: Can't move '\tmp\svn\r\db\transactions\9-9.txn\props' to '\tmp\svn\r\db\revprops\2\10': Access is denied.
@@@ The above error was expected.
@@@ This will work:
* Verified revision 2.
@@@ Packing...
@@@ This will fail:
..\..\..\subversion\libsvn_fs_fs\fs_fs.c:3695: (apr_err=160004)
svnadmin: Invalid changes line in rev-file
Daniel
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=993717
Re: Locks and recoveries of packed repositories (was: Re: packing
causes 'svnadmin verify' to fail)
Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
Daniel Shahaf wrote on Sun, 28 Dec 2008 at 15:36 +0200:
> [[[
> Fix 'svnadmin recover' of packed FSFS repositories.
>
> * subversion/libsvn_fs_fs/fs_fs.c
> (recover_get_largest_revision):
> Use open_pack_or_rev_file() instead of svn_fs_fs__path_rev() to look
> for the rev files.
> ]]]
>
r34993.
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=997071
Locks and recoveries of packed repositories (was: Re: packing
causes 'svnadmin verify' to fail)
Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
Daniel Shahaf wrote on Sat, 27 Dec 2008 at 23:42 +0200:
> Hyrum K. Wright wrote on Sat, 27 Dec 2008 at 14:00 -0600:
> > Daniel Shahaf wrote:
> > > P.S. I've also noticed that 'svnadmin recover svn-r9-packed' (where
> > > svn-r9-packed is the repository created by the script I gave in the
> > > original mail) fails (both with and without the patch) with the error:
> > >
> > > ..\..\..\subversion\libsvn_fs_fs\fs_fs.c:6155: (apr_err=160004)
> > > svnadmin: Expected current rev to be <= 0 but found 9
> >
> > Does this happen with the inconsistent repository you created, or with the sync
> > running to some sort of completion? What about a non-packed repository which
> > was aborted?
> >
>
> It happens on a 3-revisions packed Greek repository, and doesn't happen
> on the same repository after I dump|load it to get a non-packed version.
> The results with the packed/non-packed syncs of the svn repository are
> consistent (error only with the packed sync). In short, it seems to
> happen iff the repos is packed.
>
And a patch:
[[[
Fix 'svnadmin recover' of packed FSFS repositories.
* subversion/libsvn_fs_fs/fs_fs.c
(recover_get_largest_revision):
Use open_pack_or_rev_file() instead of svn_fs_fs__path_rev() to look
for the rev files.
]]]
[[[
Index: subversion/libsvn_fs_fs/fs_fs.c
===================================================================
--- subversion/libsvn_fs_fs/fs_fs.c (revision 34960)
+++ subversion/libsvn_fs_fs/fs_fs.c (working copy)
@@ -5878,13 +5881,19 @@ recover_get_largest_revision(svn_fs_t *fs, svn_rev
/* Keep doubling right, until we find a revision that doesn't exist. */
while (1)
{
- svn_node_kind_t kind;
- SVN_ERR(svn_io_check_path(svn_fs_fs__path_rev(fs, right, iterpool),
- &kind, iterpool));
+ svn_error_t *err;
+ apr_file_t *file;
+
+ err = open_pack_or_rev_file(&file, fs, right, iterpool);
svn_pool_clear(iterpool);
- if (kind == svn_node_none)
- break;
+ if (err && err->apr_err == SVN_ERR_FS_NO_SUCH_REVISION)
+ {
+ svn_error_clear(err);
+ break;
+ }
+ else
+ SVN_ERR(err);
right <<= 1;
}
@@ -5896,16 +5905,22 @@ recover_get_largest_revision(svn_fs_t *fs, svn_rev
while (left + 1 < right)
{
svn_revnum_t probe = left + ((right - left) / 2);
- svn_node_kind_t kind;
+ svn_error_t *err;
+ apr_file_t *file;
- SVN_ERR(svn_io_check_path(svn_fs_fs__path_rev(fs, probe, iterpool),
- &kind, iterpool));
+ err = open_pack_or_rev_file(&file, fs, probe, iterpool);
svn_pool_clear(iterpool);
- if (kind == svn_node_none)
- right = probe;
+ if (err && err->apr_err == SVN_ERR_FS_NO_SUCH_REVISION)
+ {
+ svn_error_clear(err);
+ right = probe;
+ }
else
- left = probe;
+ {
+ SVN_ERR(err);
+ left = probe;
+ }
}
svn_pool_destroy(iterpool);
]]]
The root of the problem was that svn_fs_fs__path_rev() only works
correctly for non-packed revs. I suggest also the following patch:
[[[
Index: subversion/libsvn_fs_fs/fs_fs.c
===================================================================
--- subversion/libsvn_fs_fs/fs_fs.c (revision 34960)
+++ subversion/libsvn_fs_fs/fs_fs.c (working copy)
@@ -196,6 +196,9 @@ svn_fs_fs__path_rev(svn_fs_t *fs, svn_revnum_t rev
if (ffd->max_files_per_dir)
{
+ /* We assume here that REV is not yet in a pack file. */
+ assert(rev >= ffd->min_unpacked_rev);
+
return svn_path_join(path_rev_shard(fs, rev, pool),
apr_psprintf(pool, "%ld", rev),
pool);
Index: subversion/libsvn_fs_fs/fs_fs.h
===================================================================
--- subversion/libsvn_fs_fs/fs_fs.h (revision 34960)
+++ subversion/libsvn_fs_fs/fs_fs.h (working copy)
@@ -402,6 +402,7 @@ svn_error_t *svn_fs_fs__dup_perms(const char *file
apr_pool_t *pool);
/* Return the path to the file containing revision REV in FS.
+ Only works when REV has not yet been packed.
Allocate the new char * from POOL. */
const char *svn_fs_fs__path_rev(svn_fs_t *fs,
svn_revnum_t rev,
]]]
I have checked all callers of __dup_perms(), and I think they should all
be okay, except for this one:
[[[
Index: subversion/libsvn_fs_fs/lock.c
===================================================================
--- subversion/libsvn_fs_fs/lock.c (revision 34960)
+++ subversion/libsvn_fs_fs/lock.c (working copy)
@@ -206,7 +206,7 @@ write_digest_file(apr_hash_t *children,
SVN_ERR(svn_stream_close(stream));
SVN_ERR(svn_io_file_rename(tmp_path, digest_path, pool));
- return svn_fs_fs__dup_perms
+ return svn_fs_fs__dup_perms /* XXX triggers the assertion here */
(digest_path, svn_fs_fs__path_rev(fs, 0, pool), pool);
}
]]]
which triggers the assertion added by the second patch. (This code path
is run during 'svn lock'.)
Daniel
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=994384
Re: packing causes 'svnadmin verify' to fail
Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
Hyrum K. Wright wrote on Sat, 27 Dec 2008 at 14:00 -0600:
> Daniel Shahaf wrote:
> > Daniel Shahaf wrote on Sat, 27 Dec 2008 at 20:50 +0200:
> >> IOW, it forgets to add the offset of the rev within the pack file.
> >>
> >
> > And here's the patch I'm testing:
> >
> > [[[
> > Fix 'svnadmin verify' of some packed FSFS repositories by making the
> > calculation of offsets in the rev file consistent.
> >
...
> > @@ -2309,9 +2302,15 @@ get_root_changes_offset(apr_off_t *root_offset,
> > else
> > {
> > seek_relative = APR_END;
> > - offset = 0;
> > + rev_offset = offset = 0;
>
> I don't know what our style is here, but I recommend having these assignments on
> separate lines, as it sure helps readability.
>
Okay, but I will just remove this line entirely, since 'rev_offset' is
set by the 'if' just below:
> > }
> >
> > + /* Offset of the revision from the start of the pack file, if applicable. */
> > + if (rev < ffd->min_unpacked_rev)
> > + SVN_ERR(get_packed_offset(&rev_offset, fs, rev, pool));
> > + else
> > + rev_offset = 0;
> > +
> > /* We will assume that the last line containing the two offsets
> > will never be longer than 64 characters. */
> > SVN_ERR(svn_io_file_seek(rev_file, seek_relative, &offset, pool));
...
> > ]]]
> >
> > I'll appreciate a review by someone more familiar with FSFS than me.
>
> Other than that, it looks good. It took me a minute to figure out what was
> going on here, but your solution looks reasonable.
>
Thanks for the review. Committed in r34958.
> > P.S. I've also noticed that 'svnadmin recover svn-r9-packed' (where
> > svn-r9-packed is the repository created by the script I gave in the
> > original mail) fails (both with and without the patch) with the error:
> >
> > ..\..\..\subversion\libsvn_fs_fs\fs_fs.c:6155: (apr_err=160004)
> > svnadmin: Expected current rev to be <= 0 but found 9
>
> Does this happen with the inconsistent repository you created, or with the sync
> running to some sort of completion? What about a non-packed repository which
> was aborted?
>
It happens on a 3-revisions packed Greek repository, and doesn't happen
on the same repository after I dump|load it to get a non-packed version.
The results with the packed/non-packed syncs of the svn repository are
consistent (error only with the packed sync). In short, it seems to
happen iff the repos is packed.
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=993938
Re: packing causes 'svnadmin verify' to fail
Posted by "Hyrum K. Wright" <hy...@mail.utexas.edu>.
Daniel Shahaf wrote:
> Daniel Shahaf wrote on Sat, 27 Dec 2008 at 20:50 +0200:
>> I tracked it to get_root_changes_offset(). It returns the offset from the
>> start of the revision, but later it's used to seek from the start of the
>> pack file.
>>
>> IOW, it forgets to add the offset of the rev within the pack file.
>>
>
> And here's the patch I'm testing:
>
> [[[
> Fix 'svnadmin verify' of some packed FSFS repositories by making the
> calculation of offsets in the rev file consistent.
>
> * subversion/libsvn_fs_fs/fs_fs.c
> (get_root_changes_offset):
> Return the offsets from the start of the pack file, not from the start
> of the revision data.
> (get_fs_id_at_offset):
> Don't repeat the logic that's now in get_root_changes_offset().
> ]]]
>
> [[[
> Index: subversion/libsvn_fs_fs/fs_fs.c
> ===================================================================
> --- subversion/libsvn_fs_fs/fs_fs.c (revision 34956)
> +++ subversion/libsvn_fs_fs/fs_fs.c (working copy)
> @@ -2239,14 +2239,6 @@ get_fs_id_at_offset(svn_fs_id_t **id_p,
> apr_hash_t *headers;
> const char *node_id_str;
>
> - if (rev < ffd->min_unpacked_rev)
> - {
> - apr_off_t rev_offset;
> -
> - SVN_ERR(get_packed_offset(&rev_offset, fs, rev, pool));
> - offset += rev_offset;
> - }
> -
> SVN_ERR(svn_io_file_seek(rev_file, APR_SET, &offset, pool));
>
> SVN_ERR(read_header_block(&headers,
> @@ -2287,6 +2279,7 @@ get_root_changes_offset(apr_off_t *root_offset,
> {
> fs_fs_data_t *ffd = fs->fsap_data;
> apr_off_t offset;
> + apr_off_t rev_offset;
> char buf[64];
> int i, num_bytes;
> apr_size_t len;
> @@ -2309,9 +2302,15 @@ get_root_changes_offset(apr_off_t *root_offset,
> else
> {
> seek_relative = APR_END;
> - offset = 0;
> + rev_offset = offset = 0;
I don't know what our style is here, but I recommend having these assignments on
separate lines, as it sure helps readability.
> }
>
> + /* Offset of the revision from the start of the pack file, if applicable. */
> + if (rev < ffd->min_unpacked_rev)
> + SVN_ERR(get_packed_offset(&rev_offset, fs, rev, pool));
> + else
> + rev_offset = 0;
> +
> /* We will assume that the last line containing the two offsets
> will never be longer than 64 characters. */
> SVN_ERR(svn_io_file_seek(rev_file, seek_relative, &offset, pool));
> @@ -2350,7 +2349,7 @@ get_root_changes_offset(apr_off_t *root_offset,
> i++;
>
> if (root_offset)
> - *root_offset = apr_atoi64(&buf[i]);
> + *root_offset = rev_offset + apr_atoi64(&buf[i]);
>
> /* find the next space */
> for ( ; i < (num_bytes - 2) ; i++)
> @@ -2365,7 +2364,7 @@ get_root_changes_offset(apr_off_t *root_offset,
> /* note that apr_atoi64() will stop reading as soon as it encounters
> the final newline. */
> if (changes_offset)
> - *changes_offset = apr_atoi64(&buf[i]);
> + *changes_offset = rev_offset + apr_atoi64(&buf[i]);
>
> return SVN_NO_ERROR;
> }
> ]]]
>
> I'll appreciate a review by someone more familiar with FSFS than me.
Other than that, it looks good. It took me a minute to figure out what was
going on here, but your solution looks reasonable.
> Daniel
>
> P.S. I've also noticed that 'svnadmin recover svn-r9-packed' (where
> svn-r9-packed is the repository created by the script I gave in the
> original mail) fails (both with and without the patch) with the error:
>
> ..\..\..\subversion\libsvn_fs_fs\fs_fs.c:6155: (apr_err=160004)
> svnadmin: Expected current rev to be <= 0 but found 9
Does this happen with the inconsistent repository you created, or with the sync
running to some sort of completion? What about a non-packed repository which
was aborted?
>> Daniel
>>
>> Daniel Shahaf wrote on Sat, 27 Dec 2008 at 15:39 +0200:
>>> Summary: 'svnadmin pack' can bring the repository to a state where
>>> 'svnadmin verify' fails.
>>>
>>>
>>> I can reproduce it with the svn repository, I couldn't find how to
>>> reproduce it in a Greek tree repository.
>>>
>>> Reproduction script:
>>>
>>> @echo off
>>>
>>> cd \tmp\svn
>>>
>>> echo @@@ Versions
>>> svn --version | head -2
>>> svnsync --version | head -2
>>> svnadmin --version | head -2
>>>
>>> echo @@@ Recreate the repository
>>> rd/s/q r
>>> svnadmin create r
>>> touch r\hooks\pre-revprop-change.bat
>>>
>>> echo @@@ Set small shards (so packing has an effect)
>>> ### Couldn't get perl to maintain EOL style.
>>> vim -Nneu NONE -i NONE -b -c "set noreadonly | 2s/sharded 1000/sharded 4/ | wq!" r\db\format
>>>
>>> echo @@@ Hack. Force the sync to abort after syncing r9.
>>> mkdir r\db\revprops\2\10
>>>
>>> echo @@@ Sync.
>>> svnsync init file:///tmp/svn/r http://svn.collab.net/repos/svn
>>> svnsync sync file:///tmp/svn/r
>>> echo @@@ The above error was expected.
>>>
>>> echo @@@ This will work:
>>> svnadmin verify -r2 r
>>>
>>> echo @@@ Packing...
>>> svnadmin pack r
>>>
>>> echo @@@ This will fail:
>>> svnadmin verify -r2 r
>>>
>>>
>>> Output:
>>>
>>> @@@ Versions
>>> svn, version 1.6.0 (dev build-r34949)
>>> compiled Dec 27 2008, 00:28:10
>>> svnsync, version 1.6.0 (dev build-r34949)
>>> compiled Dec 27 2008, 00:28:10
>>> svnadmin, version 1.6.0 (dev build-r34949)
>>> compiled Dec 27 2008, 00:28:10
>>> ### I actually used r34952; the output is wrong.
>>> @@@ Recreate the repository
>>> @@@ Set small shards (so packing has an effect)
>>> @@@ Hack. Force the sync to abort after syncing r9.
>>> @@@ Sync.
>>> Copied properties for revision 0.
>>> Transmitting file data .........................................................
>>> ................................................................................
>>> ................................................................................
>>> ................................................................................
>>> ................................................................................
>>> ................................................................................
>>> .........................................................
>>> Committed revision 1.
>>> Copied properties for revision 1.
>>> Transmitting file data .
>>> Committed revision 2.
>>> Copied properties for revision 2.
>>> Transmitting file data .
>>> Committed revision 3.
>>> Copied properties for revision 3.
>>> Transmitting file data .
>>> Committed revision 4.
>>> Copied properties for revision 4.
>>> Transmitting file data .
>>> Committed revision 5.
>>> Copied properties for revision 5.
>>> Transmitting file data .
>>> Committed revision 6.
>>> Copied properties for revision 6.
>>> Transmitting file data .
>>> Committed revision 7.
>>> Copied properties for revision 7.
>>> Transmitting file data .
>>> Committed revision 8.
>>> Copied properties for revision 8.
>>> Transmitting file data .
>>> Committed revision 9.
>>> Copied properties for revision 9.
>>> Transmitting file data .
>>> ..\..\..\subversion\libsvn_subr\io.c:2900: (apr_err=720005)
>>> svnsync: Can't move '\tmp\svn\r\db\transactions\9-9.txn\props' to '\tmp\svn\r\db\revprops\2\10': Access is denied.
>>> @@@ The above error was expected.
>>> @@@ This will work:
>>> * Verified revision 2.
>>> @@@ Packing...
>>> @@@ This will fail:
>>> ..\..\..\subversion\libsvn_fs_fs\fs_fs.c:3695: (apr_err=160004)
>>> svnadmin: Invalid changes line in rev-file
>>>
>>> Daniel
>>>
>>> ------------------------------------------------------
>>> http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=993717
>>>
>
> ------------------------------------------------------
> http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=993838
>
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=993860
Re: packing causes 'svnadmin verify' to fail
Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
Daniel Shahaf wrote on Sat, 27 Dec 2008 at 20:50 +0200:
> I tracked it to get_root_changes_offset(). It returns the offset from the
> start of the revision, but later it's used to seek from the start of the
> pack file.
>
> IOW, it forgets to add the offset of the rev within the pack file.
>
And here's the patch I'm testing:
[[[
Fix 'svnadmin verify' of some packed FSFS repositories by making the
calculation of offsets in the rev file consistent.
* subversion/libsvn_fs_fs/fs_fs.c
(get_root_changes_offset):
Return the offsets from the start of the pack file, not from the start
of the revision data.
(get_fs_id_at_offset):
Don't repeat the logic that's now in get_root_changes_offset().
]]]
[[[
Index: subversion/libsvn_fs_fs/fs_fs.c
===================================================================
--- subversion/libsvn_fs_fs/fs_fs.c (revision 34956)
+++ subversion/libsvn_fs_fs/fs_fs.c (working copy)
@@ -2239,14 +2239,6 @@ get_fs_id_at_offset(svn_fs_id_t **id_p,
apr_hash_t *headers;
const char *node_id_str;
- if (rev < ffd->min_unpacked_rev)
- {
- apr_off_t rev_offset;
-
- SVN_ERR(get_packed_offset(&rev_offset, fs, rev, pool));
- offset += rev_offset;
- }
-
SVN_ERR(svn_io_file_seek(rev_file, APR_SET, &offset, pool));
SVN_ERR(read_header_block(&headers,
@@ -2287,6 +2279,7 @@ get_root_changes_offset(apr_off_t *root_offset,
{
fs_fs_data_t *ffd = fs->fsap_data;
apr_off_t offset;
+ apr_off_t rev_offset;
char buf[64];
int i, num_bytes;
apr_size_t len;
@@ -2309,9 +2302,15 @@ get_root_changes_offset(apr_off_t *root_offset,
else
{
seek_relative = APR_END;
- offset = 0;
+ rev_offset = offset = 0;
}
+ /* Offset of the revision from the start of the pack file, if applicable. */
+ if (rev < ffd->min_unpacked_rev)
+ SVN_ERR(get_packed_offset(&rev_offset, fs, rev, pool));
+ else
+ rev_offset = 0;
+
/* We will assume that the last line containing the two offsets
will never be longer than 64 characters. */
SVN_ERR(svn_io_file_seek(rev_file, seek_relative, &offset, pool));
@@ -2350,7 +2349,7 @@ get_root_changes_offset(apr_off_t *root_offset,
i++;
if (root_offset)
- *root_offset = apr_atoi64(&buf[i]);
+ *root_offset = rev_offset + apr_atoi64(&buf[i]);
/* find the next space */
for ( ; i < (num_bytes - 2) ; i++)
@@ -2365,7 +2364,7 @@ get_root_changes_offset(apr_off_t *root_offset,
/* note that apr_atoi64() will stop reading as soon as it encounters
the final newline. */
if (changes_offset)
- *changes_offset = apr_atoi64(&buf[i]);
+ *changes_offset = rev_offset + apr_atoi64(&buf[i]);
return SVN_NO_ERROR;
}
]]]
I'll appreciate a review by someone more familiar with FSFS than me.
Daniel
P.S. I've also noticed that 'svnadmin recover svn-r9-packed' (where
svn-r9-packed is the repository created by the script I gave in the
original mail) fails (both with and without the patch) with the error:
..\..\..\subversion\libsvn_fs_fs\fs_fs.c:6155: (apr_err=160004)
svnadmin: Expected current rev to be <= 0 but found 9
> Daniel
>
> Daniel Shahaf wrote on Sat, 27 Dec 2008 at 15:39 +0200:
> > Summary: 'svnadmin pack' can bring the repository to a state where
> > 'svnadmin verify' fails.
> >
> >
> > I can reproduce it with the svn repository, I couldn't find how to
> > reproduce it in a Greek tree repository.
> >
> > Reproduction script:
> >
> > @echo off
> >
> > cd \tmp\svn
> >
> > echo @@@ Versions
> > svn --version | head -2
> > svnsync --version | head -2
> > svnadmin --version | head -2
> >
> > echo @@@ Recreate the repository
> > rd/s/q r
> > svnadmin create r
> > touch r\hooks\pre-revprop-change.bat
> >
> > echo @@@ Set small shards (so packing has an effect)
> > ### Couldn't get perl to maintain EOL style.
> > vim -Nneu NONE -i NONE -b -c "set noreadonly | 2s/sharded 1000/sharded 4/ | wq!" r\db\format
> >
> > echo @@@ Hack. Force the sync to abort after syncing r9.
> > mkdir r\db\revprops\2\10
> >
> > echo @@@ Sync.
> > svnsync init file:///tmp/svn/r http://svn.collab.net/repos/svn
> > svnsync sync file:///tmp/svn/r
> > echo @@@ The above error was expected.
> >
> > echo @@@ This will work:
> > svnadmin verify -r2 r
> >
> > echo @@@ Packing...
> > svnadmin pack r
> >
> > echo @@@ This will fail:
> > svnadmin verify -r2 r
> >
> >
> > Output:
> >
> > @@@ Versions
> > svn, version 1.6.0 (dev build-r34949)
> > compiled Dec 27 2008, 00:28:10
> > svnsync, version 1.6.0 (dev build-r34949)
> > compiled Dec 27 2008, 00:28:10
> > svnadmin, version 1.6.0 (dev build-r34949)
> > compiled Dec 27 2008, 00:28:10
> > ### I actually used r34952; the output is wrong.
> > @@@ Recreate the repository
> > @@@ Set small shards (so packing has an effect)
> > @@@ Hack. Force the sync to abort after syncing r9.
> > @@@ Sync.
> > Copied properties for revision 0.
> > Transmitting file data .........................................................
> > ................................................................................
> > ................................................................................
> > ................................................................................
> > ................................................................................
> > ................................................................................
> > .........................................................
> > Committed revision 1.
> > Copied properties for revision 1.
> > Transmitting file data .
> > Committed revision 2.
> > Copied properties for revision 2.
> > Transmitting file data .
> > Committed revision 3.
> > Copied properties for revision 3.
> > Transmitting file data .
> > Committed revision 4.
> > Copied properties for revision 4.
> > Transmitting file data .
> > Committed revision 5.
> > Copied properties for revision 5.
> > Transmitting file data .
> > Committed revision 6.
> > Copied properties for revision 6.
> > Transmitting file data .
> > Committed revision 7.
> > Copied properties for revision 7.
> > Transmitting file data .
> > Committed revision 8.
> > Copied properties for revision 8.
> > Transmitting file data .
> > Committed revision 9.
> > Copied properties for revision 9.
> > Transmitting file data .
> > ..\..\..\subversion\libsvn_subr\io.c:2900: (apr_err=720005)
> > svnsync: Can't move '\tmp\svn\r\db\transactions\9-9.txn\props' to '\tmp\svn\r\db\revprops\2\10': Access is denied.
> > @@@ The above error was expected.
> > @@@ This will work:
> > * Verified revision 2.
> > @@@ Packing...
> > @@@ This will fail:
> > ..\..\..\subversion\libsvn_fs_fs\fs_fs.c:3695: (apr_err=160004)
> > svnadmin: Invalid changes line in rev-file
> >
> > Daniel
> >
> > ------------------------------------------------------
> > http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=993717
> >
>
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=993838
Re: packing causes 'svnadmin verify' to fail
Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
I tracked it to get_root_changes_offset(). It returns the offset from the
start of the revision, but later it's used to seek from the start of the
pack file.
IOW, it forgets to add the offset of the rev within the pack file.
Daniel
Daniel Shahaf wrote on Sat, 27 Dec 2008 at 15:39 +0200:
> Summary: 'svnadmin pack' can bring the repository to a state where
> 'svnadmin verify' fails.
>
>
> I can reproduce it with the svn repository, I couldn't find how to
> reproduce it in a Greek tree repository.
>
> Reproduction script:
>
> @echo off
>
> cd \tmp\svn
>
> echo @@@ Versions
> svn --version | head -2
> svnsync --version | head -2
> svnadmin --version | head -2
>
> echo @@@ Recreate the repository
> rd/s/q r
> svnadmin create r
> touch r\hooks\pre-revprop-change.bat
>
> echo @@@ Set small shards (so packing has an effect)
> ### Couldn't get perl to maintain EOL style.
> vim -Nneu NONE -i NONE -b -c "set noreadonly | 2s/sharded 1000/sharded 4/ | wq!" r\db\format
>
> echo @@@ Hack. Force the sync to abort after syncing r9.
> mkdir r\db\revprops\2\10
>
> echo @@@ Sync.
> svnsync init file:///tmp/svn/r http://svn.collab.net/repos/svn
> svnsync sync file:///tmp/svn/r
> echo @@@ The above error was expected.
>
> echo @@@ This will work:
> svnadmin verify -r2 r
>
> echo @@@ Packing...
> svnadmin pack r
>
> echo @@@ This will fail:
> svnadmin verify -r2 r
>
>
> Output:
>
> @@@ Versions
> svn, version 1.6.0 (dev build-r34949)
> compiled Dec 27 2008, 00:28:10
> svnsync, version 1.6.0 (dev build-r34949)
> compiled Dec 27 2008, 00:28:10
> svnadmin, version 1.6.0 (dev build-r34949)
> compiled Dec 27 2008, 00:28:10
> ### I actually used r34952; the output is wrong.
> @@@ Recreate the repository
> @@@ Set small shards (so packing has an effect)
> @@@ Hack. Force the sync to abort after syncing r9.
> @@@ Sync.
> Copied properties for revision 0.
> Transmitting file data .........................................................
> ................................................................................
> ................................................................................
> ................................................................................
> ................................................................................
> ................................................................................
> .........................................................
> Committed revision 1.
> Copied properties for revision 1.
> Transmitting file data .
> Committed revision 2.
> Copied properties for revision 2.
> Transmitting file data .
> Committed revision 3.
> Copied properties for revision 3.
> Transmitting file data .
> Committed revision 4.
> Copied properties for revision 4.
> Transmitting file data .
> Committed revision 5.
> Copied properties for revision 5.
> Transmitting file data .
> Committed revision 6.
> Copied properties for revision 6.
> Transmitting file data .
> Committed revision 7.
> Copied properties for revision 7.
> Transmitting file data .
> Committed revision 8.
> Copied properties for revision 8.
> Transmitting file data .
> Committed revision 9.
> Copied properties for revision 9.
> Transmitting file data .
> ..\..\..\subversion\libsvn_subr\io.c:2900: (apr_err=720005)
> svnsync: Can't move '\tmp\svn\r\db\transactions\9-9.txn\props' to '\tmp\svn\r\db\revprops\2\10': Access is denied.
> @@@ The above error was expected.
> @@@ This will work:
> * Verified revision 2.
> @@@ Packing...
> @@@ This will fail:
> ..\..\..\subversion\libsvn_fs_fs\fs_fs.c:3695: (apr_err=160004)
> svnadmin: Invalid changes line in rev-file
>
> Daniel
>
> ------------------------------------------------------
> http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=993717
>
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=993831