Bug #58538 Race as READ can be sent together with buffered INS/UPD/DEL, if using triggers
Submitted: 28 Nov 2010 9:56 Modified: 29 Nov 2010 11:40
Reporter: Jonas Oreland Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S3 (Non-critical)
Version: OS:Any
Assigned to: Jonas Oreland CPU Architecture:Any

[28 Nov 2010 9:56] Jonas Oreland
Description:
looking at ndb_trigger,
it will send a scan (index) of a table together with an delete on the same
table. This is a inherent race, as we don't make any guarantees to
if scan will reach the record before/after the delete.
 

How to repeat:
Look at signal log from ndb_trigger

Suggested fix:
make sure any bufferer INS/UPD/DEL are flushed before issuing any reads.
[28 Nov 2010 9:57] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/125243

3351 jonas oreland	2010-11-28
      ndb - bug#58538 - make sure any buffered DML are flushed before sending any reads
[28 Nov 2010 9:59] Bugs System
Pushed into mysql-5.1-telco-6.3 5.1.51-ndb-6.3.40 (revid:jonas@mysql.com-20101128095839-tf9m1vkbxl6yugwv) (version source revid:jonas@mysql.com-20101128095839-tf9m1vkbxl6yugwv) (merge vers: 5.1.51-ndb-6.3.40) (pib:23)
[28 Nov 2010 11:38] Bugs System
Pushed into mysql-5.1-telco-7.0 5.1.51-ndb-7.0.21 (revid:jonas@mysql.com-20101128113805-nvbp3by6bsztw0ln) (version source revid:jonas@mysql.com-20101128113805-nvbp3by6bsztw0ln) (merge vers: 5.1.51-ndb-7.0.21) (pib:23)
[28 Nov 2010 15:16] Jonas Oreland
pushed to 6.3.40, 7.0.21 and 7.1.10

DOCS: So the problem is that triggers could read old data.
  (SQL triggers that is). But I never managed to write a testcase
   for it, that didn't involve reading signal logs.
[29 Nov 2010 11:40] Jon Stephens
Documented bugfix in the NDB-6.3.40, 7.0.21, and 7.0.10 changelogs as follows:

      In some circumstances, an SQL trigger on an NDB table could read 
      stale data.

Closed.