You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Mark <ma...@mitsein.net> on 2006/09/14 18:24:53 UTC

svnsync

I am curious aboyut this new feature.  I have a custom solution in
place to keep repositories synced between two servers, one bein the
master and one being the standby.  I can switch roles between servers
as well.  From my first read of what info their is about svnsync, it
sounds like the destination repository is only ever meant to be
read-only.  Is that a hard and fast rule?  Is there something I could
do to switch the roles of destination and source repositories?

A HOWTO for new features like this will help a lot.  I'm willing to
write it with some help from the devs that put this feature together.

-- 
Mark
"Blessed is he who finds happiness in his own foolishness, for he will
always be happy."

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: svnsync

Posted by Garrett Rooney <ro...@electricjellyfish.net>.
On 9/14/06, Duncan Murdoch <mu...@stats.uwo.ca> wrote:

> These are the things I'd like to do, off the top of my head:
>
>   - use the sync'd copy to tell me the history of a file in a working
> copy from the original repos (when I'm offline, without access to the
> original). Would I need to switch the WC, get the log, and switch back?

Sure, although in order to actually switch (actually, switch
--relocate) to the read-only mirror you'd need to make sure that your
mirror has the same UUID as the destination repository.  There's a
kinda hacky way to make this work via svnadmin load:

$ cat - <<EOF | svnadmin load repos
SVN-fs-dump-format-version: 2
UUID: 65390229-12b7-0310-b90b-f21a5aa7ec8e
EOF

Replacing the UUID with whatever the UUID of your source repository is.

>   - use the sync'd copy instead of having the text-base originals for
> the purpose of doing a "revert", to save disk space.

Nope.

>   - check out a read-only working copy, and be warned if I tried to use
> it in a dangerous way (e.g. by committing from it or otherwise treating
> it as if it was from a regular repos).

Assuming you've played the UUID trick, sure, you just need to set up a
pre-commit-hook script on your mirror that only allows commits from a
particular user (that's used for the sync) and disallows all others,
that way you can't accidentally commit to it.

>   - be able to switch from the working copy checked out above to the
> original one at the appropriate revision.

Works fine with switch --relocate, so long as you've made sure the
UUIDs are the same.

>   - be able to make a backup of a repository when I have read access,
> but not administrative access.  I would have thought this was the main
> idea, but then the description of how to convert between master and
> slave makes it sound as though it's not.

Sure you can use it to make a backup, and that was one of the main
goals, it's just that if you start making commits to that backup
you're not going to be able to sync it anymore.  So if you hit that
disaster case where your main repository is offline and you have to
start using your backup as your new repository you need to turn your
backup into the new master once the problem is corrected.

Another use case that this was intended for was for true read-only
mirrors.  For example, svn.apache.org is a pretty busy subversion
server, but a LOT of its traffic is from non-committers, so some time
in the future we might switch it to committer-only access, but provide
read-only mirrors for anonymous users that are maintained via svnsync.

-garrett

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: svnsync

Posted by Duncan Murdoch <mu...@stats.uwo.ca>.
On 9/14/2006 7:49 PM, Garrett Rooney wrote:
> On 9/14/06, Duncan Murdoch <mu...@stats.uwo.ca> wrote:
>> On 9/14/2006 2:38 PM, Garrett Rooney wrote:
>>> On 9/14/06, Mark <ma...@mitsein.net> wrote:
>>>> I am curious aboyut this new feature.  I have a custom solution in
>>>> place to keep repositories synced between two servers, one bein the
>>>> master and one being the standby.  I can switch roles between servers
>>>> as well.  From my first read of what info their is about svnsync, it
>>>> sounds like the destination repository is only ever meant to be
>>>> read-only.  Is that a hard and fast rule?  Is there something I could
>>>> do to switch the roles of destination and source repositories?
>>> It's not a hard and fast rule, but to switch which repos is the master
>>> and which is the slave you'd have to manually go in and mess with the
>>> svnsync revprops on r0 of whichever is the slave.  It's definately a
>>> hard and fast rule that you can only have one master at any given
>>> time.  If you write to both the slave and the master then there's no
>>> mechanism for resolving the inconsistency.
>>>
>>>> A HOWTO for new features like this will help a lot.  I'm willing to
>>>> write it with some help from the devs that put this feature together.
>>> Paul Querna put up a HOWTO for basic read-only mirroring on his blog yesterday:
>>>
>>> http://journal.paul.querna.org/articles/2006/09/14/using-svnsync
>> Is there other documentation online somewhere?  That page lists the
>> how-to, but not the things you can do with the sync'd copy.
> 
> There's not a whole lot of documentation yet, but as far as "what you
> can do with the sync'd copy" I'm not sure what you're looking for.
> You can do anything with the copy that doesn't involve writing to it.
> Well, actually, you can write to it, but only if you never want to
> sync it again.

These are the things I'd like to do, off the top of my head:

  - use the sync'd copy to tell me the history of a file in a working 
copy from the original repos (when I'm offline, without access to the 
original). Would I need to switch the WC, get the log, and switch back?

  - use the sync'd copy instead of having the text-base originals for 
the purpose of doing a "revert", to save disk space.

  - check out a read-only working copy, and be warned if I tried to use 
it in a dangerous way (e.g. by committing from it or otherwise treating 
it as if it was from a regular repos).

  - be able to switch from the working copy checked out above to the 
original one at the appropriate revision.

  - be able to make a backup of a repository when I have read access, 
but not administrative access.  I would have thought this was the main 
idea, but then the description of how to convert between master and 
slave makes it sound as though it's not.

I guess I just don't get the point of svnsync yet.

Duncan Murdoch

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: svnsync

Posted by Garrett Rooney <ro...@electricjellyfish.net>.
On 9/14/06, Duncan Murdoch <mu...@stats.uwo.ca> wrote:
> On 9/14/2006 2:38 PM, Garrett Rooney wrote:
> > On 9/14/06, Mark <ma...@mitsein.net> wrote:
> >> I am curious aboyut this new feature.  I have a custom solution in
> >> place to keep repositories synced between two servers, one bein the
> >> master and one being the standby.  I can switch roles between servers
> >> as well.  From my first read of what info their is about svnsync, it
> >> sounds like the destination repository is only ever meant to be
> >> read-only.  Is that a hard and fast rule?  Is there something I could
> >> do to switch the roles of destination and source repositories?
> >
> > It's not a hard and fast rule, but to switch which repos is the master
> > and which is the slave you'd have to manually go in and mess with the
> > svnsync revprops on r0 of whichever is the slave.  It's definately a
> > hard and fast rule that you can only have one master at any given
> > time.  If you write to both the slave and the master then there's no
> > mechanism for resolving the inconsistency.
> >
> >> A HOWTO for new features like this will help a lot.  I'm willing to
> >> write it with some help from the devs that put this feature together.
> >
> > Paul Querna put up a HOWTO for basic read-only mirroring on his blog yesterday:
> >
> > http://journal.paul.querna.org/articles/2006/09/14/using-svnsync
>
> Is there other documentation online somewhere?  That page lists the
> how-to, but not the things you can do with the sync'd copy.

There's not a whole lot of documentation yet, but as far as "what you
can do with the sync'd copy" I'm not sure what you're looking for.
You can do anything with the copy that doesn't involve writing to it.
Well, actually, you can write to it, but only if you never want to
sync it again.

-garrett

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: svnsync

Posted by Duncan Murdoch <mu...@stats.uwo.ca>.
On 9/14/2006 2:38 PM, Garrett Rooney wrote:
> On 9/14/06, Mark <ma...@mitsein.net> wrote:
>> I am curious aboyut this new feature.  I have a custom solution in
>> place to keep repositories synced between two servers, one bein the
>> master and one being the standby.  I can switch roles between servers
>> as well.  From my first read of what info their is about svnsync, it
>> sounds like the destination repository is only ever meant to be
>> read-only.  Is that a hard and fast rule?  Is there something I could
>> do to switch the roles of destination and source repositories?
> 
> It's not a hard and fast rule, but to switch which repos is the master
> and which is the slave you'd have to manually go in and mess with the
> svnsync revprops on r0 of whichever is the slave.  It's definately a
> hard and fast rule that you can only have one master at any given
> time.  If you write to both the slave and the master then there's no
> mechanism for resolving the inconsistency.
> 
>> A HOWTO for new features like this will help a lot.  I'm willing to
>> write it with some help from the devs that put this feature together.
> 
> Paul Querna put up a HOWTO for basic read-only mirroring on his blog yesterday:
> 
> http://journal.paul.querna.org/articles/2006/09/14/using-svnsync

Is there other documentation online somewhere?  That page lists the 
how-to, but not the things you can do with the sync'd copy.

Duncan Murdohc

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: svnsync

Posted by Garrett Rooney <ro...@electricjellyfish.net>.
On 9/19/06, Mark <ma...@mitsein.net> wrote:
> would be nice if the sync didn;t trigger all the post-commit stuff on
> the dest right after it triggers on the src :)

Sorry, nothing we can do there, it's just a normal commit.  If you
want special treatment your post-commit scripts need to recognize that
it's a sync (by looking at the user or something).

-garrett

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: svnsync

Posted by Mark <ma...@mitsein.net>.
would be nice if the sync didn;t trigger all the post-commit stuff on
the dest right after it triggers on the src :)

On 9/14/06, Garrett Rooney <ro...@electricjellyfish.net> wrote:
> On 9/14/06, Mark <ma...@mitsein.net> wrote:
> > Cool.  Looks like the props on the destination are:
> > svn:sync-currently-copying = 1
> > svn:sync-from-url = <svn url>
> > svn:sync-from-uuid = <source repo uuid>
> > svn:sync-last-merged-rev = <whatever rev>
> >
> > then there's the locking and stuff.  So, would it hurt to prepare the
> > current master for when I switch it to mirror by setting
> > svn:sync-from-url, svn:sync-from-uuid?  I'd probably set the uuids the
> > same between master and slave to make things more transparent to
> > users.  That hurt anything in svnsync?
>
> You should (I think) be able to get away with getting rid of the
> revprops on the new master, and adding the from-url, from-uuid, and
> last-merged-rev on the new slave.  No promises though, I've never
> tried it ;-)
>
> -garrett
>


-- 
Mark
"Blessed is he who finds happiness in his own foolishness, for he will
always be happy."

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: svnsync

Posted by Garrett Rooney <ro...@electricjellyfish.net>.
On 9/14/06, Mark <ma...@mitsein.net> wrote:
> Cool.  Looks like the props on the destination are:
> svn:sync-currently-copying = 1
> svn:sync-from-url = <svn url>
> svn:sync-from-uuid = <source repo uuid>
> svn:sync-last-merged-rev = <whatever rev>
>
> then there's the locking and stuff.  So, would it hurt to prepare the
> current master for when I switch it to mirror by setting
> svn:sync-from-url, svn:sync-from-uuid?  I'd probably set the uuids the
> same between master and slave to make things more transparent to
> users.  That hurt anything in svnsync?

You should (I think) be able to get away with getting rid of the
revprops on the new master, and adding the from-url, from-uuid, and
last-merged-rev on the new slave.  No promises though, I've never
tried it ;-)

-garrett

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: svnsync

Posted by Mark <ma...@mitsein.net>.
Cool.  Looks like the props on the destination are:
svn:sync-currently-copying = 1
svn:sync-from-url = <svn url>
svn:sync-from-uuid = <source repo uuid>
svn:sync-last-merged-rev = <whatever rev>

then there's the locking and stuff.  So, would it hurt to prepare the
current master for when I switch it to mirror by setting
svn:sync-from-url, svn:sync-from-uuid?  I'd probably set the uuids the
same between master and slave to make things more transparent to
users.  That hurt anything in svnsync?

On 9/14/06, Garrett Rooney <ro...@electricjellyfish.net> wrote:
> On 9/14/06, Mark <ma...@mitsein.net> wrote:
> > I am curious aboyut this new feature.  I have a custom solution in
> > place to keep repositories synced between two servers, one bein the
> > master and one being the standby.  I can switch roles between servers
> > as well.  From my first read of what info their is about svnsync, it
> > sounds like the destination repository is only ever meant to be
> > read-only.  Is that a hard and fast rule?  Is there something I could
> > do to switch the roles of destination and source repositories?
>
> It's not a hard and fast rule, but to switch which repos is the master
> and which is the slave you'd have to manually go in and mess with the
> svnsync revprops on r0 of whichever is the slave.  It's definately a
> hard and fast rule that you can only have one master at any given
> time.  If you write to both the slave and the master then there's no
> mechanism for resolving the inconsistency.
>
> > A HOWTO for new features like this will help a lot.  I'm willing to
> > write it with some help from the devs that put this feature together.
>
> Paul Querna put up a HOWTO for basic read-only mirroring on his blog yesterday:
>
> http://journal.paul.querna.org/articles/2006/09/14/using-svnsync
>
> -garrett
>


-- 
Mark
"Blessed is he who finds happiness in his own foolishness, for he will
always be happy."

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: svnsync

Posted by Garrett Rooney <ro...@electricjellyfish.net>.
On 9/14/06, Mark <ma...@mitsein.net> wrote:
> I am curious aboyut this new feature.  I have a custom solution in
> place to keep repositories synced between two servers, one bein the
> master and one being the standby.  I can switch roles between servers
> as well.  From my first read of what info their is about svnsync, it
> sounds like the destination repository is only ever meant to be
> read-only.  Is that a hard and fast rule?  Is there something I could
> do to switch the roles of destination and source repositories?

It's not a hard and fast rule, but to switch which repos is the master
and which is the slave you'd have to manually go in and mess with the
svnsync revprops on r0 of whichever is the slave.  It's definately a
hard and fast rule that you can only have one master at any given
time.  If you write to both the slave and the master then there's no
mechanism for resolving the inconsistency.

> A HOWTO for new features like this will help a lot.  I'm willing to
> write it with some help from the devs that put this feature together.

Paul Querna put up a HOWTO for basic read-only mirroring on his blog yesterday:

http://journal.paul.querna.org/articles/2006/09/14/using-svnsync

-garrett

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org