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.co.il> on 2008/03/24 20:06:41 UTC

[PATCH] Check UUID at RA connection opening

Currently, the repository's uuid is not always checked when creating an RA 
connection.  This results in 'svn update' overwriting the working copy's 
uuid with the repository's new uuid, when the latter has changed.

Following discussion on IRC a few weeks ago, a check for uuid equality is 
added in svn_ra_open2(), which is revved to take a const char *uuid 
argument.  (durin42 also volunteered to write the patch, but I understood 
from him that he was busy and didn't mind that I do it if I had time.)

Two places in the code already validate the uuid by themselves: 
open_source_session() in svnsync, and validator_func() in 
libsvn_client/relocate.c (which is an svn_wc_relocation_validator3_t).
I have not modified them.

[[[
Check repository UUID when creating an RA session.  This fixes an issue
where "svn update" would silently overwrite the UUID of a working copy
if the repository UUID has changed.

Several tests in svnadmin_tests which silently took advantage of this
are fixed too.

* subversion/include/svn_ra.h
   (svn_ra_open2, svn_ra_open3):  New API revision.

* subversion/libsvn_ra/ra_loader.c
   (svn_ra_open2, svn_ra_open3):  New API revision.

* subversion/libsvn_client/ra.c
   (svn_client__open_ra_session_internal):
     When having a working copy, pass its uuid to svn_ra_open3().

* subversion/tests/cmdline/update_tests.py
   (update_uuid_changed): New test.
   (test_list): Run it.

* subversion/tests/cmdline/svnadmin_tests.py
   (extra_headers, extra_blockcontent, empty_date):
     Load dumpfile with '--ignore-uuid' in order to not change the repository
     uuid, since a working copy already has been checked out from it.

* subversion/tests/cmdline/switch_tests.py
   (switch_change_repos_root):  Change expected error message.

* subversion/include/svn_error_codes.h
   (SVN_ERR_RA_UUID_MISMATCH):  New error.
]]]

Daniel

Re: [PATCH] Check UUID at RA connection opening

Posted by Karl Fogel <kf...@red-bean.com>.
Karl Fogel <kf...@red-bean.com> writes:
> Well, over serf it always adds an extra round trip, and I'm pretty sure
> that over neon it does as well, although in theory Neon caches the UUID
> after the first retrieval (and serf could be made to do same).  But in
> any case, most of the time it probably won't be cached, because our RA
> session is new, so in practice there will be a new round trip.

s/won't be cached/won't be available from the cache/

(Sorry if that wasn't clear.)

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

Re: [PATCH] Check UUID at RA connection opening

Posted by Daniel Shahaf <d....@daniel.shahaf.co.il>.
Justin Erenkrantz wrote on Tue, 25 Mar 2008 at 14:47 -0400:
> On Tue, Mar 25, 2008 at 2:39 PM, Daniel Shahaf <d....@daniel.shahaf.co.il> wrote:
>>  It does add a round trip over neon, but I suspect it shouldn't.
>
> What about for ra_serf?  -- justin
>

I haven't tried serf yet.  (i.e. "I haven't tried installing serf and 
building svn with it")

Daniel



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

Re: [PATCH] Check UUID at RA connection opening

Posted by Justin Erenkrantz <ju...@erenkrantz.com>.
On Tue, Mar 25, 2008 at 2:39 PM, Daniel Shahaf <d....@daniel.shahaf.co.il> wrote:
>  It does add a round trip over neon, but I suspect it shouldn't.

What about for ra_serf?  -- justin

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

Re: [PATCH] Check UUID at RA connection opening

Posted by Karl Fogel <kf...@red-bean.com>.
Daniel Shahaf <d....@daniel.shahaf.co.il> writes:
> I looked into it.  Unfortunately, I will not be able to test my
> hypotheses soon (I won't have time next week at all), but I'll
> summarise them here now.
>
> For neon, I think (hypothesis #1) moving the "insert the UUID to the cache"
> logic to svn_ra_neon__get_starting_props (and making __get_baseline_info() go
> through __get_starting_props() instead of calling  __get_props_resource()
> directly) would prevent the duplicate request.
>
> For serf, all requests for UUID go through the generic property retrieval
> functions, so I assume (hypothesis #2) that the UUID would always be
> put in the cache when it is first seen.
>
> Does this sound right?

Yep, and Justin Erenkrantz already confirmed #2 for us IIRC.

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

Re: [PATCH] Check UUID at RA connection opening

Posted by Justin Erenkrantz <ju...@erenkrantz.com>.
On Thu, Mar 27, 2008 at 9:57 AM, Daniel Shahaf <d....@daniel.shahaf.co.il> wrote:
>  For serf, all requests for UUID go through the generic property retrieval
>  functions, so I assume (hypothesis #2) that the UUID would always be
>  put in the cache when it is first seen.
>
>  Does this sound right?

For serf, that sounds like what I'd expect it to do.  -- justin

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

Re: [PATCH] Check UUID at RA connection opening

Posted by Daniel Shahaf <d....@daniel.shahaf.co.il>.
Daniel Shahaf wrote on Wed, 26 Mar 2008 at 08:08 +0200:
> Karl Fogel wrote on Tue, 25 Mar 2008 at 19:31 -0400:
>> Daniel Shahaf <d....@daniel.shahaf.co.il> writes:
>>> It does add a round trip over neon, but I suspect it shouldn't.
>>> 
>>> Specifically, the following PROPFIND request, which neon makes early in
>>> an 'svn up' connection:
>>>
>>>     <?xml version="1.0" encoding="utf-8"?>
>>>     <propfind xmlns="DAV:">
>>>     <prop>
>>>     <version-controlled-configuration xmlns="DAV:"/>
>>>     <resourcetype xmlns="DAV:"/>
>>>     <baseline-relative-path 
>>> xmlns="http://subversion.tigris.org/xmlns/dav/"/>
>>>     <repository-uuid xmlns="http://subversion.tigris.org/xmlns/dav/"/>
>>>     </prop></propfind>
>>> 
>>> is sent twice if the patch is applied, and once if it isn't.
>> 
>> Ah, thanks.  Can you make it cache the UUID whenever it first receives
>> the UUID?  That would solve this.
>> 
>
> I'll look into it.  I see that svn_ra_neon__do_get_uuid() already caches the 
> UUID;  next, I'll find out whether the baseline-relative-path codepath also 
> caches the UUID (if it sees it).
>

I looked into it.  Unfortunately, I will not be able to test my hypotheses 
soon (I won't have time next week at all), but I'll summarise them here 
now.

For neon, I think (hypothesis #1) moving the "insert the UUID to the cache"
logic to svn_ra_neon__get_starting_props (and making __get_baseline_info() go
through __get_starting_props() instead of calling  __get_props_resource()
directly) would prevent the duplicate request.

For serf, all requests for UUID go through the generic property retrieval
functions, so I assume (hypothesis #2) that the UUID would always be 
put in the cache when it is first seen.

Does this sound right?

Daniel,
who will verify his hypotheses when he has some time again.



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

Re: [PATCH] Check UUID at RA connection opening

Posted by Daniel Shahaf <d....@daniel.shahaf.co.il>.
Karl Fogel wrote on Tue, 25 Mar 2008 at 19:31 -0400:
> Daniel Shahaf <d....@daniel.shahaf.co.il> writes:
>> It does add a round trip over neon, but I suspect it shouldn't.
>>
>> Specifically, the following PROPFIND request, which neon makes early in
>> an 'svn up' connection:
>>
>>     <?xml version="1.0" encoding="utf-8"?>
>>     <propfind xmlns="DAV:">
>>     <prop>
>>     <version-controlled-configuration xmlns="DAV:"/>
>>     <resourcetype xmlns="DAV:"/>
>>     <baseline-relative-path xmlns="http://subversion.tigris.org/xmlns/dav/"/>
>>     <repository-uuid xmlns="http://subversion.tigris.org/xmlns/dav/"/>
>>     </prop></propfind>
>>
>> is sent twice if the patch is applied, and once if it isn't.
>
> Ah, thanks.  Can you make it cache the UUID whenever it first receives
> the UUID?  That would solve this.
>

I'll look into it.  I see that svn_ra_neon__do_get_uuid() already caches 
the UUID;  next, I'll find out whether the baseline-relative-path codepath 
also caches the UUID (if it sees it).

>> Should this patch go into 1.5.0?  I won't have time to set up an Apache
>> build environment in time for the release.
>
> IMHO, no.  It's not a 1.5-blocking bug (after all, if we weren't
> checking UUID all this time, then it's not such a big deal if the fix
> comes out in 1.5.1 or 1.6 instead of 1.5).
>
> -Karl
>

Okay.

Daniel


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

Re: [PATCH] Check UUID at RA connection opening

Posted by Karl Fogel <kf...@red-bean.com>.
Daniel Shahaf <d....@daniel.shahaf.co.il> writes:
> It does add a round trip over neon, but I suspect it shouldn't.
>
> Specifically, the following PROPFIND request, which neon makes early in
> an 'svn up' connection:
>
>     <?xml version="1.0" encoding="utf-8"?>
>     <propfind xmlns="DAV:">
>     <prop>
>     <version-controlled-configuration xmlns="DAV:"/>
>     <resourcetype xmlns="DAV:"/>
>     <baseline-relative-path xmlns="http://subversion.tigris.org/xmlns/dav/"/>
>     <repository-uuid xmlns="http://subversion.tigris.org/xmlns/dav/"/>
>     </prop></propfind>
>
> is sent twice if the patch is applied, and once if it isn't.

Ah, thanks.  Can you make it cache the UUID whenever it first receives
the UUID?  That would solve this.

> Should this patch go into 1.5.0?  I won't have time to set up an Apache
> build environment in time for the release.

IMHO, no.  It's not a 1.5-blocking bug (after all, if we weren't
checking UUID all this time, then it's not such a big deal if the fix
comes out in 1.5.1 or 1.6 instead of 1.5).

-Karl

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

Re: [PATCH] Check UUID at RA connection opening

Posted by Daniel Shahaf <d....@daniel.shahaf.co.il>.
Karl Fogel wrote on Tue, 25 Mar 2008 at 11:38 -0400:
> Daniel Shahaf <d....@daniel.shahaf.co.il> writes:
>> --- subversion/libsvn_ra/ra_loader.c	(revision 30027)
>> +++ subversion/libsvn_ra/ra_loader.c	(working copy)
>> @@ -468,10 +469,37 @@ svn_ra_create_callbacks(svn_ra_callbacks2_t **call
>>    SVN_ERR(vtable->open_session(session, repos_URL, callbacks, callback_baton,
>>                                 config, pool));
>>
>> +  /* Check the UUID. */
>> +  if (uuid)
>> +    {
>> +      const char *actual_uuid;
>> +
>> +      SVN_ERR(vtable->get_uuid(session, &actual_uuid, pool));
>> +
>> +      if (strcmp(uuid, actual_uuid) != 0)
>> +        {
>> +          return svn_error_createf(SVN_ERR_RA_UUID_MISMATCH, NULL,
>> +                                   _("Repository UUID '%s' doesn't match "
>> +                                     "expected UUID '%s'"),
>> +                                   actual_uuid, uuid);
>> +        }
>> +    }
>> +
>>    *session_p = session;
>>    return SVN_NO_ERROR;
>>  }
>
> Nice patch!  Log message looks good, doc strings look good, etc.
>
> I'm worried about the above part of the change, though.  Over http:// it
> adds an extra round-trip to the server.
>

It does add a round trip over neon, but I suspect it shouldn't.

Specifically, the following PROPFIND request, which neon makes early in
an 'svn up' connection:

     <?xml version="1.0" encoding="utf-8"?>
     <propfind xmlns="DAV:">
     <prop>
     <version-controlled-configuration xmlns="DAV:"/>
     <resourcetype xmlns="DAV:"/>
     <baseline-relative-path xmlns="http://subversion.tigris.org/xmlns/dav/"/>
     <repository-uuid xmlns="http://subversion.tigris.org/xmlns/dav/"/>
     </prop></propfind>

is sent twice if the patch is applied, and once if it isn't.

> Well, over serf it always adds an extra round trip, and I'm pretty sure
> that over neon it does as well, although in theory Neon caches the UUID
> after the first retrieval (and serf could be made to do same).  But in
> any case, most of the time it probably won't be cached, because our RA
> session is new, so in practice there will be a new round trip.
>
> A better way might be to modify the server to always send back the UUID
> along with whatever information it was already sending back, and modify
> the client to grab that UUID if available and check that it matches.
> Obviously, if either client and server are old, then there will be no
> check, but that's okay -- we've gone this long without it, so a slow and
> soft upgrade cycle is acceptable.
>
> I realize that's probably a harder patch, but I'm really loathe to stack
> on more and more round trips.  Our DAV layer already has too many.
>
> Thoughts?
>
> -Karl
>

Should this patch go into 1.5.0?  I won't have time to set up an Apache
build environment in time for the release.

Daniel


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

Re: [PATCH] Check UUID at RA connection opening

Posted by Karl Fogel <kf...@red-bean.com>.
"Justin Erenkrantz" <ju...@erenkrantz.com> writes:
> ra_serf has a property cache too, so if we've called get_repos_root
> before, it won't incur a round-trip.  If we do call get_repos_root
> later (which usually happens), then ra_serf won't do that round-trip
> again.

Thanks, Justin, and sorry for the libel against ra_serf :-).

Did you mean "get_uuid" where you wrote "get_repos_root" the second
time, by the way?

So, Daniel, some more code inspection might be in order, to determine if
you are or aren't adding a new round-trip for certain RA layers...

> FWIW, ra_serf has a generic property cache, while ra_neon only caches
> a few hard-coded properties - so ra_serf tries very hard not to call
> the server multiple times for the same properties...  -- justin

*nod*

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

Re: [PATCH] Check UUID at RA connection opening

Posted by Justin Erenkrantz <ju...@erenkrantz.com>.
On Tue, Mar 25, 2008 at 11:38 AM, Karl Fogel <kf...@red-bean.com> wrote:
>  Well, over serf it always adds an extra round trip, and I'm pretty sure
>  that over neon it does as well, although in theory Neon caches the UUID
>  after the first retrieval (and serf could be made to do same).  But in

ra_serf has a property cache too, so if we've called get_repos_root
before, it won't incur a round-trip.  If we do call get_repos_root
later (which usually happens), then ra_serf won't do that round-trip
again.

FWIW, ra_serf has a generic property cache, while ra_neon only caches
a few hard-coded properties - so ra_serf tries very hard not to call
the server multiple times for the same properties...  -- justin

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

Re: [PATCH] Check UUID at RA connection opening

Posted by Karl Fogel <kf...@red-bean.com>.
Daniel Shahaf <d....@daniel.shahaf.co.il> writes:
> --- subversion/libsvn_ra/ra_loader.c	(revision 30027)
> +++ subversion/libsvn_ra/ra_loader.c	(working copy)
> @@ -468,10 +469,37 @@ svn_ra_create_callbacks(svn_ra_callbacks2_t **call
>    SVN_ERR(vtable->open_session(session, repos_URL, callbacks, callback_baton,
>                                 config, pool));
>  
> +  /* Check the UUID. */
> +  if (uuid)
> +    {
> +      const char *actual_uuid;
> +
> +      SVN_ERR(vtable->get_uuid(session, &actual_uuid, pool));
> +
> +      if (strcmp(uuid, actual_uuid) != 0)
> +        {
> +          return svn_error_createf(SVN_ERR_RA_UUID_MISMATCH, NULL,
> +                                   _("Repository UUID '%s' doesn't match "
> +                                     "expected UUID '%s'"),
> +                                   actual_uuid, uuid);
> +        }
> +    }
> +
>    *session_p = session;
>    return SVN_NO_ERROR;
>  }

Nice patch!  Log message looks good, doc strings look good, etc.

I'm worried about the above part of the change, though.  Over http:// it
adds an extra round-trip to the server.

Well, over serf it always adds an extra round trip, and I'm pretty sure
that over neon it does as well, although in theory Neon caches the UUID
after the first retrieval (and serf could be made to do same).  But in
any case, most of the time it probably won't be cached, because our RA
session is new, so in practice there will be a new round trip.

A better way might be to modify the server to always send back the UUID
along with whatever information it was already sending back, and modify
the client to grab that UUID if available and check that it matches.
Obviously, if either client and server are old, then there will be no
check, but that's okay -- we've gone this long without it, so a slow and
soft upgrade cycle is acceptable.

I realize that's probably a harder patch, but I'm really loathe to stack
on more and more round trips.  Our DAV layer already has too many.

Thoughts?

-Karl

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

Re: [PATCH] Neon caching (was: Re: [PATCH] Check UUID at RA connection opening)

Posted by Daniel Shahaf <d....@daniel.shahaf.co.il>.
Daniel Shahaf wrote on Sun, 6 Apr 2008 at 15:38 +0300:
> The attached patch implements this, and passes all tests now.

Ping.  If no one objects, I'll file both patches in the issue tracker.

Daniel




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

Re: [PATCH] Neon caching (was: Re: [PATCH] Check UUID at RA connection opening)

Posted by Daniel Shahaf <d....@daniel.shahaf.co.il>.
Daniel Shahaf wrote on Sat, 5 Apr 2008 at 21:41 +0300:
> Daniel Shahaf wrote on Sat, 5 Apr 2008 at 17:52 +0300:
>> Karl Fogel wrote on Fri, 4 Apr 2008 at 15:37 -0400:
>>> Daniel Shahaf <d....@daniel.shahaf.co.il> writes:
>>>> Pinging myself.  The patch below is blocked on the Neon UUID caching
>>>> fix Karl suggested.  I already wrote that (ra_neon) patch, and will
>>>> install Apache today to test it.  (I would have installed it in
>>>> advance had I known it would be necessary, of course.)
>>> 
>>> Thanks for the heads-up, looking forward to it.
>>> 
>>> -K
>>> 
>> 
>> Update.  During some 'update' operations there are three requests for
>> the starting_props (two pre-existing and one added by the patch), but
>> not all of them are for the UUID; some of them are for DAV:resourcetype
>> or for baseline-relative-path.
>> 
>> I assume these are not safe to cache, since many tests failed when
>> I tried to cache (in the session struct) the baseline-relative-path in
>> addition to the VCC and UUID.  (The VCC is safe to cache:  according to
>> lgo, ra_serf caches it.)
>> 
>> Therefore, I suppose caching UUID and VCC only will work (that is: will 
>> prevent round-trips when only the VCC and/or UUID are needed), and I will 
>> try that next.  However, it will not eliminate duplication completely, as
>> far as I see.
>> 
>
> Attached patch to cache only UUID and VCC.  It passes all tests except
> lock_tests 11, where the 'unlock' fails with a 404.  I do not know what
> the cause is, yet.  Could it be related to the VCC caching?

Yes, partly; I should have checked the cache only in __do_get_uuid() and
in __get_vcc(), rather than in __get_starting_props() as I did.

The attached patch implements this, and passes all tests now.

Thanks,

Daniel (the morning edition)

[PATCH] Neon caching (was: Re: [PATCH] Check UUID at RA connection opening)

Posted by Daniel Shahaf <d....@daniel.shahaf.co.il>.
Daniel Shahaf wrote on Sat, 5 Apr 2008 at 17:52 +0300:
> Karl Fogel wrote on Fri, 4 Apr 2008 at 15:37 -0400:
>> Daniel Shahaf <d....@daniel.shahaf.co.il> writes:
>>> Pinging myself.  The patch below is blocked on the Neon UUID caching
>>> fix Karl suggested.  I already wrote that (ra_neon) patch, and will
>>> install Apache today to test it.  (I would have installed it in
>>> advance had I known it would be necessary, of course.)
>> 
>> Thanks for the heads-up, looking forward to it.
>> 
>> -K
>> 
>
> Update.  During some 'update' operations there are three requests for
> the starting_props (two pre-existing and one added by the patch), but
> not all of them are for the UUID; some of them are for DAV:resourcetype
> or for baseline-relative-path.
>
> I assume these are not safe to cache, since many tests failed when
> I tried to cache (in the session struct) the baseline-relative-path in
> addition to the VCC and UUID.  (The VCC is safe to cache:  according to
> lgo, ra_serf caches it.)
>
> Therefore, I suppose caching UUID and VCC only will work (that is: will 
> prevent round-trips when only the VCC and/or UUID are needed), and I will try 
> that next.  However, it will not eliminate duplication completely, as
> far as I see.
>

Attached patch to cache only UUID and VCC.  It passes all tests except
lock_tests 11, where the 'unlock' fails with a 404.  I do not know what
the cause is, yet.  Could it be related to the VCC caching?

Daniel

Re: [PATCH] Check UUID at RA connection opening

Posted by Daniel Shahaf <d....@daniel.shahaf.co.il>.
Karl Fogel wrote on Fri, 4 Apr 2008 at 15:37 -0400:
> Daniel Shahaf <d....@daniel.shahaf.co.il> writes:
>> Pinging myself.  The patch below is blocked on the Neon UUID caching
>> fix Karl suggested.  I already wrote that (ra_neon) patch, and will
>> install Apache today to test it.  (I would have installed it in
>> advance had I known it would be necessary, of course.)
>
> Thanks for the heads-up, looking forward to it.
>
> -K
>

Update.  During some 'update' operations there are three requests for
the starting_props (two pre-existing and one added by the patch), but
not all of them are for the UUID; some of them are for DAV:resourcetype
or for baseline-relative-path.

I assume these are not safe to cache, since many tests failed when
I tried to cache (in the session struct) the baseline-relative-path in
addition to the VCC and UUID.  (The VCC is safe to cache:  according to
lgo, ra_serf caches it.)

Therefore, I suppose caching UUID and VCC only will work (that is: will 
prevent round-trips when only the VCC and/or UUID are needed), and I will 
try that next.  However, it will not eliminate duplication completely, as
far as I see.

Daniel



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

Re: [PATCH] Check UUID at RA connection opening

Posted by Karl Fogel <kf...@red-bean.com>.
Daniel Shahaf <d....@daniel.shahaf.co.il> writes:
> Pinging myself.  The patch below is blocked on the Neon UUID caching
> fix Karl suggested.  I already wrote that (ra_neon) patch, and will
> install Apache today to test it.  (I would have installed it in
> advance had I known it would be necessary, of course.)

Thanks for the heads-up, looking forward to it.

-K

> Daniel Shahaf wrote on Mon, 24 Mar 2008 at 22:06 +0200:
>> Currently, the repository's uuid is not always checked when creating
>> an RA connection.  This results in 'svn update' overwriting the
>> working copy's uuid with the repository's new uuid, when the latter
>> has changed.
>>
>> Following discussion on IRC a few weeks ago, a check for uuid
>> equality is added in svn_ra_open2(), which is revved to take a const
>> char *uuid argument.  (durin42 also volunteered to write the patch,
>> but I understood from him that he was busy and didn't mind that I do
>> it if I had time.)
>>
>> Two places in the code already validate the uuid by themselves:
>> open_source_session() in svnsync, and validator_func() in
>> libsvn_client/relocate.c (which is an
>> svn_wc_relocation_validator3_t).
>> I have not modified them.
>>
>> [[[
>> Check repository UUID when creating an RA session.  This fixes an issue
>> where "svn update" would silently overwrite the UUID of a working copy
>> if the repository UUID has changed.
>>
>> Several tests in svnadmin_tests which silently took advantage of this
>> are fixed too.
>>
>> * subversion/include/svn_ra.h
>>  (svn_ra_open2, svn_ra_open3):  New API revision.
>>
>> * subversion/libsvn_ra/ra_loader.c
>>  (svn_ra_open2, svn_ra_open3):  New API revision.
>>
>> * subversion/libsvn_client/ra.c
>>  (svn_client__open_ra_session_internal):
>>    When having a working copy, pass its uuid to svn_ra_open3().
>>
>> * subversion/tests/cmdline/update_tests.py
>>  (update_uuid_changed): New test.
>>  (test_list): Run it.
>>
>> * subversion/tests/cmdline/svnadmin_tests.py
>>  (extra_headers, extra_blockcontent, empty_date):
>>    Load dumpfile with '--ignore-uuid' in order to not change the
>> repository
>>    uuid, since a working copy already has been checked out from it.
>>
>> * subversion/tests/cmdline/switch_tests.py
>>  (switch_change_repos_root):  Change expected error message.
>>
>> * subversion/include/svn_error_codes.h
>>  (SVN_ERR_RA_UUID_MISMATCH):  New error.
>> ]]]
>>
>> Daniel
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: dev-help@subversion.tigris.org

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

Re: [PATCH] Check UUID at RA connection opening

Posted by Daniel Shahaf <d....@daniel.shahaf.co.il>.
Daniel Shahaf wrote on Fri, 4 Apr 2008 at 12:51 +0300:
> Daniel Shahaf wrote on Mon, 24 Mar 2008 at 22:06 +0200:
> > [[[
> > Check repository UUID when creating an RA session.  This fixes an issue
> > where "svn update" would silently overwrite the UUID of a working copy
> > if the repository UUID has changed.
> > 

Filed as issue #3177.

http://subversion.tigris.org/issues/show_bug.cgi?id=3177

> Pinging myself.  The patch below is blocked on the Neon UUID caching fix Karl
> suggested.

The Neon fix was committed in r30666.


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

Re: [PATCH] Check UUID at RA connection opening

Posted by Daniel Shahaf <d....@daniel.shahaf.co.il>.
Pinging myself.  The patch below is blocked on the Neon UUID caching fix 
Karl suggested.  I already wrote that (ra_neon) patch, and will install 
Apache today to test it.  (I would have installed it in advance had I 
known it would be necessary, of course.)

Daniel


Daniel Shahaf wrote on Mon, 24 Mar 2008 at 22:06 +0200:
> Currently, the repository's uuid is not always checked when creating an RA 
> connection.  This results in 'svn update' overwriting the working copy's 
> uuid with the repository's new uuid, when the latter has changed.
>
> Following discussion on IRC a few weeks ago, a check for uuid equality is 
> added in svn_ra_open2(), which is revved to take a const char *uuid 
> argument.  (durin42 also volunteered to write the patch, but I understood 
> from him that he was busy and didn't mind that I do it if I had time.)
>
> Two places in the code already validate the uuid by themselves: 
> open_source_session() in svnsync, and validator_func() in 
> libsvn_client/relocate.c (which is an svn_wc_relocation_validator3_t).
> I have not modified them.
>
> [[[
> Check repository UUID when creating an RA session.  This fixes an issue
> where "svn update" would silently overwrite the UUID of a working copy
> if the repository UUID has changed.
>
> Several tests in svnadmin_tests which silently took advantage of this
> are fixed too.
>
> * subversion/include/svn_ra.h
>  (svn_ra_open2, svn_ra_open3):  New API revision.
>
> * subversion/libsvn_ra/ra_loader.c
>  (svn_ra_open2, svn_ra_open3):  New API revision.
>
> * subversion/libsvn_client/ra.c
>  (svn_client__open_ra_session_internal):
>    When having a working copy, pass its uuid to svn_ra_open3().
>
> * subversion/tests/cmdline/update_tests.py
>  (update_uuid_changed): New test.
>  (test_list): Run it.
>
> * subversion/tests/cmdline/svnadmin_tests.py
>  (extra_headers, extra_blockcontent, empty_date):
>    Load dumpfile with '--ignore-uuid' in order to not change the 
> repository
>    uuid, since a working copy already has been checked out from it.
>
> * subversion/tests/cmdline/switch_tests.py
>  (switch_change_repos_root):  Change expected error message.
>
> * subversion/include/svn_error_codes.h
>  (SVN_ERR_RA_UUID_MISMATCH):  New error.
> ]]]
>
> Daniel
>


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