Bug #42459 Falcon transactional consistency broken on WHERE IN( ... )
Submitted: 29 Jan 2009 16:23 Modified: 15 May 2009 13:27
Reporter: Philip Stoev Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Falcon storage engine Severity:S2 (Serious)
Version:6.0-falcon-team OS:Any
Assigned to: Kevin Lewis CPU Architecture:Any
Tags: F_ISOLATION

[29 Jan 2009 16:23] Philip Stoev
Description:
When executing a workload containing queries of the form:

UPDATE `table10_falcon_int_autoinc` SET `int` = `int` + IF(`pk` % 2 = 1 , 30, -30) WHERE `pk` IN ( 3 , 4 );

which update the database so that the sum of the integers is always consistent, the table will appear temporarily inconsistent when observed from a different connection.

How to repeat:
A test case will be uploaded shortly.
[29 Jan 2009 16:26] Philip Stoev
Grammar file for bug 42459

Attachment: bug42459.yy (application/octet-stream, text), 1.50 KiB.

[29 Jan 2009 16:28] Philip Stoev
To reproduce, run this a couple of times:

$ perl runall.pl \
  --basedir=/build/bzr/6.0-falcon-team \
  --mysqld=--loose-innodb-lock-wait-timeout=1 \
  --mysqld=--table-lock-wait-timeout=1 \
  --mysqld=--loose-falcon-lock-wait-timeout=1 \
  --mysqld=--loose-falcon-debug-mask=2 \
  --mysqld=--skip-safemalloc \
  --grammar=bug42459.yy \
  --gendata=conf/transactions.zz \
  --mysqld=--falcon-consistent-read=1 \
  --mysqld=--transaction-isolation=REPEATABLE-READ \
  --validator=DatabaseConsistency \
  --mem \
  --duration=120 \
  --mysqld=--log-output=file \
  --queries=100000 \
  --engine=Falcon
[30 Mar 2009 21:53] Kevin Lewis
Philip reported that this problem cannot be repeated after the changes to create a
TransactionState object and the addition of the CycleManager to protect doomed records until after all temporary stack pointers to them have gone away.
[15 May 2009 13:27] MC Brown
Internal/test fix only. No changelog entry required.
[15 May 2009 13:39] MC Brown
A note have been added to the 6.0.11 changelog: 

The Falcon CycleManager has been updated, which addresses a number of issues when examining records in various transaction states and their visisbility/isolation in relation to other threads.