You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Rupert Hunt <ru...@pagedevelopers.com> on 2009/02/14 09:55:22 UTC

2 users working on same file caused a change to be reverted rather than merged

Hello

After a few months of using svn and everything behaving as it should do,
something happened yesterday that has totally undermined my confidence in
it:

There are 2 developers working on their own working copies, committing to a
remote server where the repository is held.

Yesterday, both were working on the same file.

Developer 1 added a few lines around line 10 but then changed his mind and
deleted them, but unintentionally left an extra line return in there meaning
the file was modified even if no different functionally.

Developer 2 commented out some lines around line 100 and added some
additional lines of code.

Developer 2 commits the change.

Developer 1 later commits, but instead of svn failing and returning the
usual out of date message or merging the 2 sets of changes, the commit
succeeds and overwrites Developer 2's changes. I.e the old lines were un
commented and the new lines removed.

Revision history confirms this sequence.

Does anyone know why this might have happened? The only unusual thing we
have discovered is that the server clock was 10 mins behind our local
clocks.

Many thanks for any help you can give

Rupert

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1156973

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: 2 users working on same file caused a change to be reverted rather than merged

Posted by Toby Thain <to...@telegraphics.com.au>.
On 17-Feb-09, at 11:21 PM, Andreas Schweigstill wrote:

> Hello!
>
> Toby Thain schrieb:
>> This is a flaw of *all* RAID-1 systems, software or hardware
>> (excepting the few in the high end that implement checksums).
>
> No, it is only related to some OS which do some performance
> optimizations. On Solaris one can set md_mirror:md_mirror_wow_flg=0x20
> which disables performance optimization.
>
>> It also risks integrity if the system suffers a sudden interruption
>> during writing (e.g. powerfail, panic, etc).
>
> That is another problem which can't be completely solved. But this
> has nearly nothing to do with normal operation.
>
>>> Nowadays these WOW problems "should" be non-existing but I am not
>>> dure since when Linux soft-RAID handles them correctly.
>>
>> There is no solution; the flaw is inherent in the design. *Non-
>> checksummed* RAID-1 cannot determine which side of the mirror holds
>> valid data.
>
> They just can't determine the valid mirror side in the case of an
> interruption or for computing clusters which access the same disks.
>
> And for normal use it is not important that both sides of the mirror
> contain the same data also on short timescales. It is sufficient that
> read operations on the same sector/block return consistent data.

There are several ways the mirror sides can get out of sync  
unbeknownst to the storage layer. Sudden interruption is only the  
most common. RAID-1 users should be aware that in general there is no  
recourse when it does.

--Toby

>
>> Sun's ZFS solves this problem entirely.
>
> ZFS solves many problems, but the WOW problem was/is mainly present on
> Solaris systems using the normal Sun Volume Manager with UFS.
>
> Regards
> Andreas Schweigstill
>
> -- 
> Dipl.-Phys. Andreas Schweigstill
> Schweigstill IT | Embedded Systems
> Schauenburgerstraße 116, D-24118 Kiel, Germany
> Phone: (+49) 431 53035-435, Fax: (+49) 431 53035-436
> Mobile: (+49) 171 6921973, Web: http://www.schweigstill.de/
>
> ------------------------------------------------------
> http://subversion.tigris.org/ds/viewMessage.do? 
> dsForumId=1065&dsMessageId=1183336
>
> To unsubscribe from this discussion, e-mail: [users- 
> unsubscribe@subversion.tigris.org].

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1186160

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].


Re: 2 users working on same file caused a change to be reverted rather than merged

Posted by Andreas Schweigstill <an...@schweigstill.de>.
Hello!

Toby Thain schrieb:
> This is a flaw of *all* RAID-1 systems, software or hardware  
> (excepting the few in the high end that implement checksums).

No, it is only related to some OS which do some performance
optimizations. On Solaris one can set md_mirror:md_mirror_wow_flg=0x20
which disables performance optimization.

> It also risks integrity if the system suffers a sudden interruption  
> during writing (e.g. powerfail, panic, etc).

That is another problem which can't be completely solved. But this
has nearly nothing to do with normal operation.

>> Nowadays these WOW problems "should" be non-existing but I am not
>> dure since when Linux soft-RAID handles them correctly.
> 
> There is no solution; the flaw is inherent in the design. *Non- 
> checksummed* RAID-1 cannot determine which side of the mirror holds  
> valid data.

They just can't determine the valid mirror side in the case of an
interruption or for computing clusters which access the same disks.

And for normal use it is not important that both sides of the mirror
contain the same data also on short timescales. It is sufficient that
read operations on the same sector/block return consistent data.

> Sun's ZFS solves this problem entirely.

ZFS solves many problems, but the WOW problem was/is mainly present on
Solaris systems using the normal Sun Volume Manager with UFS.

Regards
Andreas Schweigstill

-- 
Dipl.-Phys. Andreas Schweigstill
Schweigstill IT | Embedded Systems
Schauenburgerstraße 116, D-24118 Kiel, Germany
Phone: (+49) 431 53035-435, Fax: (+49) 431 53035-436
Mobile: (+49) 171 6921973, Web: http://www.schweigstill.de/

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1183336

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].


Re: 2 users working on same file caused a change to be reverted rather than merged

Posted by Toby Thain <to...@telegraphics.com.au>.
On 16-Feb-09, at 7:22 AM, Andreas Schweigstill wrote:

> Hello!
>
> Jan Hendrik schrieb:
>> Funny thing though: it only happens when the files already exist
>> on the Linkstation, any "new" file invariably gets the timestamp
>> it has on the local machine.
>
> There are several ways to write to an existing file. Many editors
> use a scheme where they first rename the old file to a temporary
> file, then they write their buffer contents to a new file which gets
> the old filename, and finally removes the old file with the temporary
> filename. This way it is assured that the file can be completely
> erased because of a program crash or network problem. In such cases
> the user would at least find the old file. When copying the original
> file attributes after successfully writing the new file probably
> also the old timestamp gets copied. This can either be related to
> some caching issues or just a simple programming error.

In this connection, Apple's HFS has an atomic file swap operation.

>
> On some RAID systems there is also a "feature" which is called
> WOW (write on write) problem. When a block gets twice in a short
> time to a mirrored disk it can happen that write operation 1 gets
> executed on mirropr 1 first and on mirror 2 afterwards. Write op. 2
> gets executed the other way. Due to this race condition there
> can be inconsistent states on the mirrors. Similar race conditions
> on mirrored disks can occur when write and read operations are
> interleaved.

This is a flaw of *all* RAID-1 systems, software or hardware  
(excepting the few in the high end that implement checksums).

It also risks integrity if the system suffers a sudden interruption  
during writing (e.g. powerfail, panic, etc).


>
> Nowadays these WOW problems "should" be non-existing but I am not
> dure since when Linux soft-RAID handles them correctly.

There is no solution; the flaw is inherent in the design. *Non- 
checksummed* RAID-1 cannot determine which side of the mirror holds  
valid data.

Sun's ZFS solves this problem entirely.

--Toby

>
> Regards
> Andreas Schweigstill
>
> -- 
> Dipl.-Phys. Andreas Schweigstill
> Schweigstill IT | Embedded Systems
> Schauenburgerstraße 116, D-24118 Kiel, Germany
> Phone: (+49) 431 53035-435, Fax: (+49) 431 53035-436
> Mobile: (+49) 171 6921973, Web: http://www.schweigstill.de/
>
> ------------------------------------------------------
> http://subversion.tigris.org/ds/viewMessage.do? 
> dsForumId=1065&dsMessageId=1170400
>
> To unsubscribe from this discussion, e-mail: [users- 
> unsubscribe@subversion.tigris.org].

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1179050

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].


Re: 2 users working on same file caused a change to be reverted rather than merged

Posted by Andreas Schweigstill <an...@schweigstill.de>.
Hello!

Jan Hendrik schrieb:
> Funny thing though: it only happens when the files already exist
> on the Linkstation, any "new" file invariably gets the timestamp
> it has on the local machine.

There are several ways to write to an existing file. Many editors
use a scheme where they first rename the old file to a temporary
file, then they write their buffer contents to a new file which gets
the old filename, and finally removes the old file with the temporary
filename. This way it is assured that the file can be completely
erased because of a program crash or network problem. In such cases
the user would at least find the old file. When copying the original
file attributes after successfully writing the new file probably
also the old timestamp gets copied. This can either be related to
some caching issues or just a simple programming error.

On some RAID systems there is also a "feature" which is called
WOW (write on write) problem. When a block gets twice in a short
time to a mirrored disk it can happen that write operation 1 gets
executed on mirropr 1 first and on mirror 2 afterwards. Write op. 2
gets executed the other way. Due to this race condition there
can be inconsistent states on the mirrors. Similar race conditions
on mirrored disks can occur when write and read operations are
interleaved.

Nowadays these WOW problems "should" be non-existing but I am not
dure since when Linux soft-RAID handles them correctly.

Regards
Andreas Schweigstill

-- 
Dipl.-Phys. Andreas Schweigstill
Schweigstill IT | Embedded Systems
Schauenburgerstraße 116, D-24118 Kiel, Germany
Phone: (+49) 431 53035-435, Fax: (+49) 431 53035-436
Mobile: (+49) 171 6921973, Web: http://www.schweigstill.de/

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1170400

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].


Re: 2 users working on same file caused a change to be reverted rather than merged

Posted by Jan Hendrik <li...@gmail.com>.
Concerning Re: 2 users working on same file ca
Andreas Schweigstill wrote on 16 Feb 2009, 9:03, at least in part:

> Yes, and some years ago I found out that on network shares some
> applications create timestamps based on the client's system clock and
> some on the server's. :-/ It took me several hours to figure this out
> because in most cases our production process worked properly and in
> some cases the dependencies weren't resolved properly. The behaviour
> depended on weather it was a native Windows/OS/2 application or an old
> MS-DOS application.
> 
> In mixed environments there can also occur some file synchronisation
> problems regarding to NFS and Samba, especially on older NFS server
> implementations.

This reminds me of an issue we have with an only occasionally 
used Buffalo Linkstation (NAS) running some embedded Linux with 
Samba.  When syncing files to it quite often it would set its own 
current time on the synced files, but not regularly, and probably not 
even on all files during one and the same operation.  For syncing 
always the same Windows application (Total Commander) is used. 
 It might have something to do with how much local time deviates 
from NAS time, but I never investigated that.  Funny thing though: it 
only happens when the files already exist on the Linkstation, any 
"new" file invariably gets the timestamp it has on the local machine.

Jan Hendrik

---------------------------------------
Freedom quote:

     Facts do not cease to exist because they are ignored.
               -- Aldous Huxley

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1170020

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: 2 users working on same file caused a change to be reverted rather than merged

Posted by Andreas Schweigstill <an...@schweigstill.de>.
Hello!

Jan Hendrik schrieb:
> There is a catch, however: files that change, but to a time/date 
> older than last saved in the editor are not necessarily 
> recognized/reported.

Yes, and some years ago I found out that on network shares some
applications create timestamps based on the client's system clock
and some on the server's. :-/ It took me several hours to figure this
out because in most cases our production process worked properly
and in some cases the dependencies weren't resolved properly. The
behaviour depended on weather it was a native Windows/OS/2 application
or an old MS-DOS application.

In mixed environments there can also occur some file synchronisation
problems regarding to NFS and Samba, especially on older NFS server
implementations.

Regards
Andreas Schweigstill

-- 
Dipl.-Phys. Andreas Schweigstill
Schweigstill IT | Embedded Systems
Schauenburgerstraße 116, D-24118 Kiel, Germany
Phone: (+49) 431 53035-435, Fax: (+49) 431 53035-436
Mobile: (+49) 171 6921973, Web: http://www.schweigstill.de/

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1169312

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].


Re: 2 users working on same file caused a change to be reverted rather than merged

Posted by Jan Hendrik <li...@gmail.com>.
Concerning Re: 2 users working on same file ca
Toby Thain wrote on 14 Feb 2009, 13:35, at least in part:

> That's right. It's important to use an editor which recognises when 
> the file changes under it (e.g. BBEdit on MacOS, or Eclipse/Subclipse 
> on any platform).

... and SciTE (any platform), Homesite (Windows) to name a 
couple more.

There is a catch, however: files that change, but to a time/date 
older than last saved in the editor are not necessarily 
recognized/reported.

Jan Hndrik
---------------------------------------
Freedom quote:

     The object and practice of liberty lies
     in the limitation of governmental power.
               -- Gen. Douglas MacArthur

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1159524

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: 2 users working on same file caused a change to be reverted rather than merged

Posted by Toby Thain <to...@telegraphics.com.au>.
On 14-Feb-09, at 10:30 AM, Matthieu Moy wrote:

> Rupert Hunt <ru...@pagedevelopers.com> writes:
>
>> Does anyone know why this might have happened?
>
> The usual mistake is :
>
> Alice opens file.txt in her editor.
>
> Bob opens file.txt in his editor.
> Bob edits, and commits.
>
> Alice runs "update" outside her editor.
> Alice saves the file to disk, overwritting "update"'s changes.
> Alice commits. :-(.

That's right. It's important to use an editor which recognises when  
the file changes under it (e.g. BBEdit on MacOS, or Eclipse/Subclipse  
on any platform).

--Toby

>
> -- 
> Matthieu
>
> ------------------------------------------------------
> http://subversion.tigris.org/ds/viewMessage.do? 
> dsForumId=1065&dsMessageId=1158433
>
> To unsubscribe from this discussion, e-mail: [users- 
> unsubscribe@subversion.tigris.org].

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1159309

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: 2 users working on same file caused a change to be reverted rather than merged

Posted by Matthieu Moy <Ma...@imag.fr>.
Rupert Hunt <ru...@pagedevelopers.com> writes:

> Does anyone know why this might have happened?

The usual mistake is :

Alice opens file.txt in her editor.

Bob opens file.txt in his editor.
Bob edits, and commits.

Alice runs "update" outside her editor.
Alice saves the file to disk, overwritting "update"'s changes.
Alice commits. :-(.

-- 
Matthieu

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1158433

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].