You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Karl Heinz Marbaise <kh...@gmx.de> on 2010/02/03 22:52:48 UTC

Question on svnsync

Hi,

i have observed a strange behaviour of svnsync in partially replicating 
  a repository (In my opinion)..

Created a local repository (svnadmin create...) change the 
pre-revprop-change hook to accept changes...and then
i initialized svnsync like the following:

  svnsync init file:///usr/local/test/t 
http://svn.apache.org/repos/asf/subversion

Now i started svnsync sync file	e:///usr/local/test/t ....

And based on that it seemed to be that all revision properties from 
1...to whatever revision the real information starts will be copied into 
this repository...and in this case it would take a looooonnnnngggg time...

So that means that the replicated repository has all revision properties 
(log messages etc.) of about 800000 revisions...and after that all 
information is coming which interesting for me...

So my suggestion is to think about an option for svnsync sync -r 
StartRev where to start with the synchronization or may be let svnsync 
analyze itself where the first revision is in which the folder 
/subversion exist ?

So what do you think?

I understand that if svnsync wouldn't replicate the revision properties 
the revision numbers of the replicated repository will change ...but for 
a partially replicated repository might that not be a problem ?

But what about just creating the revision properties in an other way (by 
svnsync itself) without content wouldn't that be faster?

Kind Regards
Karl Heinz Marbaise
-- 
SoftwareEntwicklung Beratung Schulung    Tel.: +49 (0) 2405 / 415 893
Dipl.Ing.(FH) Karl Heinz Marbaise        ICQ#: 135949029
Hauptstrasse 177                         USt.IdNr: DE191347579
52146 Würselen                           http://www.soebes.de

Re: Question on svnsync - want to quickly start from rev 800000

Posted by Philip Martin <ph...@wandisco.com>.
Julian Foad <ju...@wandisco.com> writes:

> (How to quickly generate empty revisions? Using the bindings should be
> fast and might let you commit a completely empty revision. "svnmucc" and
> "svn" do not let you commit an empty revision,

You can use dump/load and svndumpfilter to generate empty revisions:

  rm -rf repo && svnadmin create repo
  svn mkdir -mm file://`pwd`/repo/foo
  svnadmin dump repo | svndumpfilter exclude foo > emptyrev
  rm -rf repo && svnadmin create repo
  for i in `seq 1 1000` do ; svnadmin load -q repo < emptyrev ; done

You could create all 800,000 revisions like this but it's faster to
use a bigger dump file, so after you have 1000 revs do:

  svnadmin dump repo > 1000emptyrevs
  for i in `seq 1 799` do ; svnadmin load -q repo < 100emptyrevs ; done

Do it in a RAM filesystem for speed -- in a tmpfs filesystem my
low-end desktop machine can create about 1000 revisions per second.

-- 
Philip

Re: Question on svnsync - want to quickly start from rev 800000

Posted by Julian Foad <ju...@wandisco.com>.
On Wed, 2010-02-03, Karl Heinz Marbaise wrote:
> Hi,
> 
> i have observed a strange behaviour of svnsync in partially replicating 
>   a repository (In my opinion)..
> 
> Created a local repository (svnadmin create...) change the 
> pre-revprop-change hook to accept changes...and then
> i initialized svnsync like the following:
> 
>   svnsync init file:///usr/local/test/t 
> http://svn.apache.org/repos/asf/subversion
> 
> Now i started svnsync sync file	e:///usr/local/test/t ....
> 
> And based on that it seemed to be that all revision properties from 
> 1...to whatever revision the real information starts will be copied into 
> this repository...and in this case it would take a looooonnnnngggg time...
> 
> So that means that the replicated repository has all revision properties 
> (log messages etc.) of about 800000 revisions...and after that all 
> information is coming which interesting for me...

Yes, this is just what it does. The support in svnsync for "partial"
copying simply ignores the uninteresting parts of each revision tree. It
does not have a mode of operation in which some revisions can be omitted
(or extra ones added in). It assumes that the revision numbers will be
identical in the two repositories.

> So my suggestion is to think about an option for svnsync sync -r 
> StartRev where to start with the synchronization or may be let svnsync 
> analyze itself where the first revision is in which the folder 
> /subversion exist ?
> 
> So what do you think?
> 
> I understand that if svnsync wouldn't replicate the revision properties 
> the revision numbers of the replicated repository will change ...but for 
> a partially replicated repository might that not be a problem ?

I suppose it would be possible to extend svnsync to support that sort of
thing - a bit like what "svndumpfilter" and "svnadmin load" can do.

> But what about just creating the revision properties in an other way (by 
> svnsync itself) without content wouldn't that be faster?

Yes. To solve your problem quickly, you could perhaps do this outside
svnsync:

  * run "svnsync init"
  * fill the repository with 800000 empty revisions
  * run "svn ps --revprop -r 0 svn:sync-last-merged-rev 800000 $REPO"
  * run "svnsync sync"

(How to quickly generate empty revisions? Using the bindings should be
fast and might let you commit a completely empty revision. "svnmucc" and
"svn" do not let you commit an empty revision, but committing a revision
with some small change might be OK for your purpose. Maybe something
like:
  seq 1 800000 |
    while read N; do
      echo $N > foo
      svnmucc -m "" put foo
    done
)

I have not tried this method, so I am not sure whether it would work.
Does it sound like it would be worth trying, for you?

- Julian