Bug #44065 Illegal combination of operations from ndbapi can cause node failure
Submitted: 3 Apr 2009 7:54 Modified: 23 Sep 2009 9:50
Reporter: Jonas Oreland Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S3 (Non-critical)
Version:mysql-5.1-telco-6.2 OS:Any
Assigned to: Jonas Oreland CPU Architecture:Any

[3 Apr 2009 7:54] Jonas Oreland
Description:
Note: this is second half of bug#44015
---

The following sequence of operations (that in fact are illegal)
can leads to node-crash as a record gets deleted incorrectly.

---

This scenario has been observed to occur using testBlobs

Even if this sequence of operations is illegal,
the consequence (node failure) is unacceptable.
Cause a small bug in an application can effectively crash a cluster.

---

  HugoOperations hugoOps1(*pTab);
  CHECK(hugoOps1.startTransaction(pNdb) == 0);
  CHECK(hugoOps1.pkInsertRecord(pNdb, rowno) == 0);
  CHECK(hugoOps1.execute_NoCommit(pNdb) == 0);

  HugoOperations hugoOps2(*pTab);
  CHECK(hugoOps2.startTransaction(pNdb) == 0);
  
  CHECK(hugoOps2.pkDeleteRecord(pNdb, rowno) == 0);
  CHECK(hugoOps2.pkInsertRecord(pNdb, rowno) == 0);
  
  NdbTransaction* trans = hugoOps2.getTransaction();
  
  trans->executeAsynch(NdbTransaction::NoCommit, a_callback, 0);
  CHECK(hugoOps1.execute_Commit(pNdb) == 0);
  CHECK(hugoOps2.execute_Rollback(pNdb) == 0);
 

How to repeat:
see above

Suggested fix:
don't know yet, cause is not yet fully analyzed.
[3 Apr 2009 7:54] Jonas Oreland
./testBlobs -bug 36756 -skip p -seed 25487
[6 Apr 2009 8:45] 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/71422

2900 Jonas Oreland	2009-04-06
      ndb - bug#44065, only testcase, no solution :-(
[6 Apr 2009 8:58] Bugs System
Pushed into 5.1.32-ndb-6.3.25 (revid:jonas@mysql.com-20090406084747-7w0gmdpi7u1i4cv2) (version source revid:jonas@mysql.com-20090406084747-7w0gmdpi7u1i4cv2) (merge vers: 5.1.32-ndb-6.3.25) (pib:6)
[6 Apr 2009 8:58] Bugs System
Pushed into 5.1.32-ndb-7.0.5 (revid:jonas@mysql.com-20090406085525-22wvov2sojdh74qg) (version source revid:jonas@mysql.com-20090406085406-lsf1ag01rbawd0tn) (merge vers: 5.1.32-ndb-7.0.5) (pib:6)
[6 Apr 2009 8:59] Bugs System
Pushed into 5.1.32-ndb-6.2.18 (revid:jonas@mysql.com-20090406084423-n75yb7dvmwe2pg5q) (version source revid:jonas@mysql.com-20090406084423-n75yb7dvmwe2pg5q) (merge vers: 5.1.32-ndb-6.2.18) (pib:6)
[9 Apr 2009 13:58] Jonathan Miller
Is this fixed? What version should this go to?
[9 May 2009 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[22 Sep 2009 13:04] 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/84121

3002 Jonas Oreland	2009-09-22
      ndb - bug#44065
        Don't set OP_INSERT_IS_DONE when starting a new INSERT following a DELETE
          in startNext, cause if DELETE succeeded, then there must have been an 
          row to begin with and hence no insert will be done.
        
          This is different from in startNew in which a new transaction is started.
          (which should perform a new insert)
[23 Sep 2009 5:40] Jonas Oreland
fix pushed to 6.2.19, 6.3.27 and 7.0.8
[23 Sep 2009 9:50] Jon Stephens
Documented bugfix in the NDB-6.2.19, 6.3.27, and 7.0.8 changelogs, as follows:

        Performing multiple operations using the same primary key within
        the same NdbTransaction::execute() call (which is not permitted)
        could lead to a data node crash. Now such an attempt fails
        gracefully, with an error.

Closed.
[30 Sep 2009 8:13] Bugs System
Pushed into 5.1.37-ndb-6.2.19 (revid:frazer@mysql.com-20090929142503-sst6g3fs0vx9fgil) (version source revid:jonas@mysql.com-20090922130432-uxsb5cjznp4mok0k) (merge vers: 5.1.37-ndb-6.2.19) (pib:11)
[30 Sep 2009 8:13] Bugs System
Pushed into 5.1.37-ndb-6.3.28 (revid:jonas@mysql.com-20090930070741-13u316s7s2l7e1ej) (version source revid:jonas@mysql.com-20090922142626-7n1bunrzjf1aq3xx) (merge vers: 5.1.37-ndb-6.3.27) (pib:11)
[30 Sep 2009 8:14] Bugs System
Pushed into 5.1.37-ndb-7.0.9 (revid:jonas@mysql.com-20090930075942-1q6asjcp0gaeynmj) (version source revid:jonas@mysql.com-20090922143426-xoa990qm3oajuz3v) (merge vers: 5.1.37-ndb-7.0.8) (pib:11)
[30 Sep 2009 8:15] Bugs System
Pushed into 5.1.35-ndb-7.1.0 (revid:jonas@mysql.com-20090930080049-1c8a8cio9qgvhq35) (version source revid:jonas@mysql.com-20090922143838-pp2hsiy9cnr5hui2) (merge vers: 5.1.35-ndb-7.1.0) (pib:11)