Roundup Tracker - Issues

Message5074

Author schlatterbeck
Recipients ThomasAH, ber, rouilj, schlatterbeck
Date 2014-04-07.14:11:53
Message-id <20140407141139.GA23113@runtux.com>
In-reply-to <1396862302.81.0.221428083523.issue2550806@psf.upfronthosting.co.za>
On Mon, Apr 07, 2014 at 09:18:22AM +0000, Bernhard Reiter wrote:
> 
> Bernhard Reiter added the comment:
> 
> Ralf, thanks for looking into it, the analysis and the fix.
> I still have to fully read and understand it!
> 
> Just to recap: my two initial ideas were
> a) it possibly be reproduced without a new attribte, just with title or 
> something.
This is in the regression test, see the tests
testConcurrentReadCommitted
testConcurrentRepeatableRead
in the class postgresqlJournalTest in test/test_postgresql.py
The first reproduces the problem (with default transaction isolation
'read committed') the second shows that setting isolation to
'repeatable read' makes it fail with a serialization error.

> b) the use case is to be able to construct all historic values, even if they 
> are there very briefly. 
They may not be there at all when using 'read committed'. Both
transactions start at the same time and see the same old value.
This is later reflected in the history, we have the same old value
twice.

> So a change to title from "a" to "b" to "c" would all be in the log and 
> history. Now with the defect "b" could have been lost. I hope this is not 
> the case with the fix anymore.
If the changes to title occur at the same time you have two changes, one
from "a" to "b", one from "a" to "c". The two transactions are *not*
done one-after-the-other.
So the behaviour is still the same with the fix if you leave the default
isolation level at 'read committed'. Thats how SQL works.

If you change the isolation level to something higher ('repeatable
read'), you will also not get two changes "a"->"b" "b"->"c" but instead
one of the two simultaneous transactions is aborted with a serialization
error. So you end up with either "a"->"b" or "a"->"c" depending which
transaction wins the race.

Ralf
-- 
Dr. Ralf Schlatterbeck                  Tel:   +43/2243/26465-16
Open Source Consulting                  www:   http://www.runtux.com
Reichergasse 131, A-3411 Weidling       email: office@runtux.com
allmenda.com member                     email: rsc@allmenda.com
History
Date User Action Args
2014-04-07 14:11:54schlatterbecksetrecipients: + schlatterbeck, ber, rouilj, ThomasAH
2014-04-07 14:11:54schlatterbecklinkissue2550806 messages
2014-04-07 14:11:53schlatterbeckcreate