Bug #48416 Incorrect handling of fake-unique-index-triggers after upgrade from 6.3 to 7.0
Submitted: 29 Oct 2009 18:13 Modified: 30 Oct 2009 11:02
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-7.0 OS:Any
Assigned to: Jonas Oreland CPU Architecture:Any

[29 Oct 2009 18:13] Jonas Oreland
Description:
In 6.3 a unique index create 3 (internal) triggers,
  one for ins/upd/del respectively.

In 7.0, this has been changed to only have 1 trigger handling
  both ins/upd/del.

When upgrading (online) from 6.3 to 7.0
  7.0 creates "fake" entries, in order to correctly
  being able to handle fired-triggers from a 6.3 data-node
  (when cluster is running in mixed 6.3/7.0)

However,
  these fake-entries was not accounted for in trigger-id-range
  so that a new trigger being created could allocate an id used
  by the "fake" trigger, which would later when activating it
  cause error "293, inconsistent trigger"

How to repeat:
in 6.3
create table T
create unique index I

rolling upgrade to 7.0
create unique index I2 => 293

---

The problem could also occur as a result of offline alter-tables
  which create a new copy of table (including indexes that are not dropped
  in alter)

Suggested fix:
Put the triggers into trigger-id-namespace,
  so that they id's can't be reused.

---

Note: This problem would also go away,
  if rolling restarting the 7.0 cluster one extra time
  (or system restarting it) in which case the extra triggers
  would be discovered as redundant left over from upgrade
  and automatically removed.
[30 Oct 2009 7:21] 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/88675

3174 Jonas Oreland	2009-10-30
      ndb - bug#48416 - record the fake-unique-index-triggers created during upgrade as true schema object, to avoid id-collision
[30 Oct 2009 7:35] Jonas Oreland
pushed to 7.0.9
[30 Oct 2009 11:02] Jon Stephens
Documented bugfix in the NDB-7.0.9 changelog as follows:

        After upgrading a MySQL Cluster containing tables having unique
        indexes from an NDB 6.3 release to an NDB 7.0 release, attempts
        to create new unique indexes failed with inconsistent trigger
        errors (error code 293).

        For more information (including a workaround for previous MySQL
        Cluster NDB 7.0 releases), see
       
http://dev.mysql.com/doc/refman/5.1/en/mysql-cluster-upgrade-downgrade-compatibility.html.

Added workaround info to page indicated above.

(Docs changeset is here: http://lists.mysql.com/commits/88727)

Closed.