[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r1365324 - reparenting an RA session each time it's used

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: Wed, 25 Jul 2012 16:54:42 +0100 (BST)

Julian Foad wrote:

> Daniel Shahaf wrote:
>> C. Michael Pilato wrote on Tue, Jul 24, 2012 at 21:31:49 -0400:
>>> For ra_svn:  I was totally wrong.  This thing always requires network
>>> activity: a "reparent" command/response at best; at worst, the complete
>>> teardown and re-opening of the session.  This is just a side-effect of the
>>> stateful protocol.  Unlike with HTTP, the server here is privy to the
>>> "session URL" concept -- clients only perform operations using relpaths
>>> against that URL -- and so the server must be told when that has changed.
>> So... should we revv ra_svn so 1.8 clients/servers can talk to each
>> other exclusively in repos-root-relative paths?
> That sounds good to me, but I don't understand the authz impact.
> In much of the merge code, it is convenient to carry around just one RA session
> and reparent it as necessary to address (parts of) the source and target trees
> in the repository.  I have been changing more of the code to work that way, and
> would like to continue.
> If we can alleviate any ra_svn performance impact by adjusting RA_svn, that
> would seem to be best.

To reduce the load on ra_sv, there's also a coding style change I could make.  In relatively low-level merge functions, instead of unconditionally reparenting (temporarily) I could reparent only if the requested URL is not a child of the current session URL.

Instead of

  fetch_foo(url, session)
    old_url = svn_ra_reparent(url)
    result = foo(relpath="", session)

change to

  fetch_foo(url, session)
    session_url = svn_ra_get_session_url(session)
    old_url = NULL

    if (! (relpath = svn_url_skip_ancestor(session_url, url)))
        old_url = svn_ra_reparent(url)
        relpath = ""
    result = foo(relpath, session)

- Julian
Received on 2012-07-25 17:55:20 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.