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

[PATCH] Server fix for issue #3657 - Any mod_dav_svn experts out there? (was Re: svn commit: r966822)

From: Paul Burba <ptburba_at_gmail.com>
Date: Tue, 18 Jan 2011 16:44:56 -0500

> On Fri, Jan 7, 2011 at 7:08 PM, Paul Burba <ptburba_at_gmail.com> wrote:

>> Mike suggested to me that the fix for this problem can be made in
>> mod_dav_svn, since the update reporter already knows which properties
>> have changed, *regardless* of the send-all mode, but it discards this
>> information if send-all=FALSE and instead instead sends the client a
>> 'fetch-props' response. As described previously in this thread, this
>> causes the client to fetch all the properties of the path, not just
>> the changes, and *all* the props are pushed through the editor
>> callbacks as if they were all actual changes (which again is the core
>> problem of issue #3657).
>>
>> I'm working on that approach,
>
> I had pushed off the fix-it-in-mod_dav_svn approach till 1.8 since I
> was going in circles with it, but recently found another real-world
> example where this issue causes spurious conflicts on directory
> properties, see
> http://subversion.tigris.org/issues/show_bug.cgi?id=3657#desc13.
>
> This issue has existed before 1.5 so it's nothing new, but given that
> I found another non-theoretical example and given that the presence of
> mergeinfo is only going to make this issue more common[1] I thought
> I'd take another look for 1.7.
>
> I still haven't gotten anywhere with the mod_dav_svn fix, so not much
> to talk about there, but I did commit the fix for the directory
> property conflicts in
> http://svn.apache.org/viewvc?view=revision&revision=1056565. The fix
> here is pretty much the same thing I did in
> http://svn.apache.org/viewvc?view=revision&revision=966822: Filter out
> the phony prop changes in the libsvn_client/repos_diff.c
> svn_delta_editor_t change_[dir|file]_prop() callback implementations.
>
> Just to be clear about one thing, when I committed r966822 Bert asked:
>
>>> (change_file_prop): Only stash true property differences in the file
>>> baton. The DAV RA providers may be sending us all the properties on
>>> a file, not just the differences.
>>
>> Shouldn't this be fixed in the ra layer implementations then?
>>
>> This would be just 'guessing' if it is a change or a complete set.
>
> Why not the RA layer? Two reasons. The first I explained earlier in
> this thread, it reopens issue #2048 'Primary connection (of parallel
> network connections used) in ra-dav diff/merge timeout unnecessarily.'
> I won't go over that again, but even if there is a way to avoid that,
> the RA layer is simply doing what we ask it when using the DAV
> providers. Specifically, the mod_dav_svn update report handler, when
> in 'skelta' mode[2] and describing changes to a path on which a
> property has changed, asks the client to later fetch all properties
> and figure out what has changed itself, i.e. the client asks the RA
> layer to give us *all* the properties, it obliges, so where is the
> problem as far as the RA layer is concerned?
>
> So this ultimately needs to be fixed on the server. Given that, I am
> leaving these libsvn_client filters in place so a 1.7 client will DTRT
> with older servers (or maybe 1.7 servers too, since as I said, I'm not
> having great success there).
>
> As to the 'guessing', that was true. We'd go through the motions of
> filtering over ra_local and ra_svn too. A pretty minor performance
> hit, but in r1056565 I tweaked the filtering so it only applies when
> using ra_serf and ra_neon.
>
> Paul
>
> [1] simply by increasing the potential pool of property changes
> incoming during a merge.
>
> [2] Which merges always are, regardless of whether we use ra_serf or ra_neon.
>
> Paul

Ok, after many false starts and detours I finally have a server-side
fix for this issue. Pursuing a suggestion by cmpilato, I made the
mod_dav_svn update report always send property changes, regardless of
whether the report is in skelta (send-all=false) mode or non-skelta
(send-all=true) mode.

In addition to the normal serf/neon trunk tests, I tested 1.5.10 (dev
build) and 1.6.16 (dev build) against this patched 1.7 server and
there were no unexpected [1] failures.

If any mod_dav_svn experts have time to take a look at this patch I'd
appreciate it.

Thanks,

Paul

[[[
Server-side fix for issue #3657 'dav update report handler in skelta mode can
cause spurious conflicts'.

This change has two parts that are loosely related:

1) It stops mod_dav_svn from ever sending the 'fetch-props' response to a
   client, even when in skelta (i.e. send-all=false) mode. The server
   already knows what properties have changed so now it simply sends them,
   rather than telling the client to ask for them later. This prevents
   the svn_delta_editor_t change_[file|dir]_prop callback from receiving
   faux property changes when the client asks for *all* the properties.
   See http://subversion.tigris.org/issues/show_bug.cgi?id=3657 for all the
   gory details.

2) The comments in our code frequently make reference to 'modern' servers
   and clients in the context of mod_dav_svn. Unfortunately there is no such
   thing as a pre-modern server, they are all modern! The use of the term
   'modern' in our code comments predates Subversion 1.0.0, so the comments
   are misleading and the special case code for pre-modern servers (or clients)
   is unnecessary. The special-case code is interdependent with the changes in
   #1 though, so these changes are being made in one commit, despite the fact
   one could argue they are logically separate.

* subversion/libsvn_ra_neon/fetch.c

  (report_baton_t, start_element): Remove comments about 'modern' servers and
   replace as needed with discussion of whether we are in 'send-all' mode or
   not.

* subversion/mod_dav_svn/reports/update.c

  (struct item_baton_t): Remove changed_props, committed_rev, committed_date,
   and last_author members, none of these are necessary.

  (close_helper): Simplify check for when we need to send remove-prop.
   Remove code which sends 'fetch-props' to the client, we've already sent
   them. Stop sending md5-checksum, version-name, creationdate, and
   creator-displayname. All four are already sent elsewhere and latter three
   were only needed by 'non-modern clients' which don't actually exist!

  (upd_change_xxx_prop): Whether we are in send-all mode or not, we have the
   property changes already so send them now, rather than telling the client
   to 'fetch-props' later. The only time we don't send the props is for
   additions while not in send-all mode (i.e. skelta mode). In that case we
   do the bare minimum necessary to not break old clients re issue #3711.
]]]

[1] No unexpected failures, but there were these:

Serf 1.5.10 and 1.6.16:

FAIL: prop_tests.py 14: 'test binary property support'
This passes with Passes with r1058722
(http://svn.apache.org/viewvc?view=revision&revision=1058722)
backported (this is nominated for backport to both 1.5.x and 1.6.x).

Neon 1.5.10 and 1.6.16:

FAIL: log_tests.py 26: 'svn log -g target_with_bogus_mergeinfo'
This fails without the patch too, the failure is due to the way the
test is written, see
http://svn.apache.org/viewvc?view=revision&revision=926065, a change
that was (understandably) never backported.

Received on 2011-01-18 22:45:34 CET

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