Bug #34160 DLHashtable::release wo/ preceeding ::add can corrupt table
Submitted: 30 Jan 2008 10:55 Modified: 20 Feb 2008 21:47
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

[30 Jan 2008 10:55] Jonas Oreland
Description:
In some places of th code
The following pattern is used:
c_hashTable.seize(ptr);
if (someCheck == false)
  c_hashTable.release(ptr);

// NOTE that ptr was never added to hash

How to repeat:
read code :-)
or run testBackup -n BackupDDL T1 in 6.3 or higher

Suggested fix:
check case *in* hashtable,
but try to remove this pattern
(and I'll probably add an assert in 5.1)
[30 Jan 2008 10:58] 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/41412

ChangeSet@1.2591, 2008-01-30 11:58:10+01:00, jonas@perch.ndb.mysql.com +2 -0
  ndb - bug#34160
    make sure release of not added ptr does not corrupt hashtable
[30 Jan 2008 11: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/41414

ChangeSet@1.2188, 2008-01-30 12:04:37+01:00, jonas@perch.ndb.mysql.com +2 -0
  ndb - bug#34160 (drop6)
    make sure release of not added ptr does not corrupt hashtable
[30 Jan 2008 13:07] Jonas Oreland
pushed to drop6, 50-ndb, 51*telco* (not telco-6.1)
[12 Feb 2008 14:55] Jon Stephens
Documented bug fix in the 5.1.23-ndb-6.3.9 changelog as follows:

        An issue internal to the source code could periodically
        introduce corruption of NDB tables with no readily apparent
        cause.

Left in PQ status pending further merges.
[12 Feb 2008 16:09] Jon Stephens
Also documented for 5.1.23-ndb-6.2.12.
[20 Feb 2008 16:02] Bugs System
Pushed into 5.0.58
[20 Feb 2008 16:03] Bugs System
Pushed into 5.1.24-rc
[20 Feb 2008 16:03] Bugs System
Pushed into 6.0.5-alpha
[20 Feb 2008 21:47] Jon Stephens
Also documented for 5.0.58, 5.1.24, and 6.0.5.
[21 Feb 2008 9:49] Jon Stephens
Following discussion with Jonas, updated changelog entry to:

        The failure of a DDL statement could sometimes lead to node
        failures when attempting to execute subsequent DDL statements.