Mailing List Archive

Is it possible to enable database locking?
Hi,

a little test with mediawiki showed that if two users are editing the
same page in parallel, the changes of the user who saves last overwrites
(removes) all changes the other user saved.

Is it possible to enable database locking (either optimistic or
pessimistic) to prevent this?

Ciao,
Steffen
Re: Is it possible to enable database locking? [ In reply to ]
On Sat, 02 Oct 2004 00:47:32 +0200, Steffen Siebert
<steffen.siebert@logware.de> wrote:
> Hi,
>
> a little test with mediawiki showed that if two users are editing the
> same page in parallel, the changes of the user who saves last overwrites
> (removes) all changes the other user saved.

This shouldn't be the case: the second user should either: have their
edits automatically merged with those of the first user; or, receive
an "Edit conflict" screen, showing them the difference between the
conflicting versions, and asking them to manually resolve the issue.

--
Rowan Collins BSc
[IMSoP]
Is it possible to enable database locking? [ In reply to ]
Hi Rowan,

this is what I would have expected.

I did the test again and it worked as you've described it, unless the
conflicting editings are done under the same username. I don't know if
this is a bug or feature, but shouldn't be a real problem.

Thanks for you help,
Steffen
Re: Is it possible to enable database locking? [ In reply to ]
On Sat, 02 Oct 2004 00:47:32 +0200, Steffen Siebert
<steffen.siebert@logware.de> wrote:
>
> a little test with mediawiki showed that if two users are editing the
> same page in parallel, the changes of the user who saves last overwrites
> (removes) all changes the other user saved.

Are you, by any chance, running the web server/PHP on a Solaris
platform? I'm noticing the same behaviour, but only on Solaris:
Linux-based installs do the right thing. I just submitted a bug
report yesterday (#619). Seems odd that it would be OS-based, but
unless I've missed something blindingly obvious...

Later,
Steve
Re: Is it possible to enable database locking? [ In reply to ]
On Sat, 2 Oct 2004 08:55:01 -0400, Steve Elgersma <elgersma@gmail.com> wrote:
> Are you, by any chance, running the web server/PHP on a Solaris
> platform? I'm noticing the same behaviour, but only on Solaris:
> Linux-based installs do the right thing. I just submitted a bug
> report yesterday (#619). Seems odd that it would be OS-based, but
> unless I've missed something blindingly obvious...

Well, since the code merging uses an external facility (diff3) this
could easily vary between OSes. My suspicion is that the command-line
arguments aren't the same. I've added a comment to
http://bugzilla.wikipedia.org/619

--
Rowan Collins BSc
[IMSoP]
Re: Is it possible to enable database locking? [ In reply to ]
On Sat, 2 Oct 2004 08:55:01 -0400, Steve Elgersma <elgersma@gmail.com> wrote:
> On Sat, 02 Oct 2004 00:47:32 +0200, Steffen Siebert
> <steffen.siebert@logware.de> wrote:
> >
> > a little test with mediawiki showed that if two users are editing the
> > same page in parallel, the changes of the user who saves last overwrites
> > (removes) all changes the other user saved.
>
> Are you, by any chance, running the web server/PHP on a Solaris
> platform? I'm noticing the same behaviour, but only on Solaris:

Rowan called it (thanks, Rowan). Turns out it's using an external
program (diff3) as part of the conflict resolution, and it's expecting
the GNU version of diff3. In my case, it was picking up the Solaris
diff3, which has different command-line options. The solution is to
edit your LocalSettings.php, and add the line: $wgDiff3='';

Note that I had the GNU version of diff3 as well, and setting the
variable to the path to it seemed to produce the same result as the
null setting. YMMV.

The above solution can also be found on the bug page, which I've left
open in hopes that the install can be modified to test for the GNU
version of diff3.

Later,
Steve
Re: Is it possible to enable database locking? [ In reply to ]
On Sat, 02 Oct 2004 10:51:26 +0200, Steffen Siebert wrote:

> I did the test again and it worked as you've described it, unless the
> conflicting editings are done under the same username. I don't know if
> this is a bug or feature, but shouldn't be a real problem.

As I understand it, an edit conflict with yourself currently produces
"undefined" behaviour. This is probably the cause of
http://bugzilla.wikimedia.org/275 and possibly also
http://bugzilla.wikimedia.org/317

--
Rowan Collins BSc
[IMSoP]
Re: Is it possible to enable database locking? [ In reply to ]
On Oct 2, 2004, at 2:30 PM, Rowan Collins wrote:
> On Sat, 02 Oct 2004 10:51:26 +0200, Steffen Siebert wrote:
>> I did the test again and it worked as you've described it, unless the
>> conflicting editings are done under the same username. I don't know if
>> this is a bug or feature, but shouldn't be a real problem.
>
> As I understand it, an edit conflict with yourself currently produces
> "undefined" behaviour.

The edit conflict screen is disabled when the previous edit was by the
current user so that you can make an edit, hit "back", make a
correction, and save again directly.

However I'm not sure if this performs correctly with 'complex' stuff
like section editing.

> This is probably the cause of
> http://bugzilla.wikimedia.org/275 and possibly also
> http://bugzilla.wikimedia.org/317

The mystery continues!

-- brion vibber (brion @ pobox.com)
Re: Is it possible to enable database locking? [ In reply to ]
On 2 Oct 2004, at 23:40, Brion Vibber wrote:

> The edit conflict screen is disabled when the previous edit was by the
> current user so that you can make an edit, hit "back", make a
> correction, and save again directly.
> However I'm not sure if this performs correctly with 'complex' stuff
> like section editing.

It does not.
On en.wikipedia.org I repeatedly used to get edit conflicts with myself
when trying that.

>> This is probably the cause of
>> http://bugzilla.wikimedia.org/275 and possibly also
>> http://bugzilla.wikimedia.org/317
>
> The mystery continues!
>
> -- brion vibber (brion @ pobox.com)
RE: Is it possible to enable database locking? [ In reply to ]
We were also able to reproduce this behavior (changes being overwritten) when both users were editing without being logged in. Since we have an internal wiki we made login mandatory before editing pages to avoid this problem (and because many people were asking for it anyway), but that of course is not possible on many installations.

Michael Richards

PS http://meta.wikimedia.org/wiki/Require_users_log_in_to_edit

Gartnerpedia Installation:
Suse SLES 9 Linux
Apache 2.0.49-27.8
MySQL 4.0.18-32.1
PHP 4.3.4
Mediawiki 1.3