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 2009/02/21 11:44:47 UTC

[PATCH] 'hotcopy' chokes

On my mirror of the repos, I see:

    % svnadmin hotcopy svn svn2
    svnadmin: Source 'svn\db\revs\1000.pack' is not a directory


A quick look suggests that the fix (a follow-up to my r35523) might be

[[[
Index: fs_fs.c
===================================================================
--- fs_fs.c     (revision 36028)
+++ fs_fs.c     (working copy)
@@ -1448,7 +1448,8 @@
   /* First, copy packed shards. */
   for (rev = 0; rev < min_unpacked_rev; rev += max_files_per_dir)
     {
-      const char *packed_shard = apr_psprintf(iterpool, "%ld.pack", rev);
+      const char *packed_shard = apr_psprintf(iterpool, "%ld.pack",
+                                              rev / max_files_per_dir);
       const char *src_subdir_packed_shard;
       src_subdir_packed_shard = svn_path_join(src_subdir, packed_shard, pool);
 
]]]

but I haven't tested it.


Daniel

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1202430

Re: [PATCH] 'hotcopy' chokes

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
Hyrum K. Wright wrote on Mon, 23 Feb 2009 at 09:46 -0600:
> 
> On Feb 21, 2009, at 5:44 AM, Daniel Shahaf wrote:
> 
> > On my mirror of the repos, I see:
> > 
> >   % svnadmin hotcopy svn svn2
> >   svnadmin: Source 'svn\db\revs\1000.pack' is not a directory
> > 
> > 
> > A quick look suggests that the fix (a follow-up to my r35523) might be
> > 
> > [[[
> > Index: fs_fs.c
> > ===================================================================
> > --- fs_fs.c     (revision 36028)
> > +++ fs_fs.c     (working copy)
> > @@ -1448,7 +1448,8 @@
> >  /* First, copy packed shards. */
> >  for (rev = 0; rev < min_unpacked_rev; rev += max_files_per_dir)
> >    {
> > -      const char *packed_shard = apr_psprintf(iterpool, "%ld.pack", rev);
> > +      const char *packed_shard = apr_psprintf(iterpool, "%ld.pack",
> > +                                              rev / max_files_per_dir);
> >      const char *src_subdir_packed_shard;
> >      src_subdir_packed_shard = svn_path_join(src_subdir, packed_shard,
> > pool);
> > 
> > ]]]
> 
> The patch looks reasonable, but I haven't tested it either.  Is there some
> unit test which tickles this bug?
> 

There isn't; I committed r35523 as part of making sure that 'make check' 
passes when packing is enabled [1].  However, if you have a repository 
with shard_size == 4 and min_unpacked_rev >= 8, the bug should reproduce.

Daniel




[1] All combinations I tried passed, with one exception: svnadmin_tests 12
and 17 failed if packing was enabled via -DPACK_AFTER_EVERY_COMMIT
(r35524) instead of via the --fsfs-{packing,sharding} arguments to the
Python tests.

> -Hyrum

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1215378

Re: [PATCH] 'hotcopy' chokes

Posted by "Hyrum K. Wright" <hy...@mail.utexas.edu>.
On Feb 21, 2009, at 5:44 AM, Daniel Shahaf wrote:

> On my mirror of the repos, I see:
>
>    % svnadmin hotcopy svn svn2
>    svnadmin: Source 'svn\db\revs\1000.pack' is not a directory
>
>
> A quick look suggests that the fix (a follow-up to my r35523) might be
>
> [[[
> Index: fs_fs.c
> ===================================================================
> --- fs_fs.c     (revision 36028)
> +++ fs_fs.c     (working copy)
> @@ -1448,7 +1448,8 @@
>   /* First, copy packed shards. */
>   for (rev = 0; rev < min_unpacked_rev; rev += max_files_per_dir)
>     {
> -      const char *packed_shard = apr_psprintf(iterpool, "%ld.pack",  
> rev);
> +      const char *packed_shard = apr_psprintf(iterpool, "%ld.pack",
> +                                              rev /  
> max_files_per_dir);
>       const char *src_subdir_packed_shard;
>       src_subdir_packed_shard = svn_path_join(src_subdir,  
> packed_shard, pool);
>
> ]]]

The patch looks reasonable, but I haven't tested it either.  Is there  
some unit test which tickles this bug?

-Hyrum

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1215189