Bug #67515 Cluster replication to InnoDB fails on any update
Submitted: 8 Nov 2012 0:13 Modified: 28 Jun 2017 19:34
Reporter: Paulo Rodrigues Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Cluster: Replication Severity:S1 (Critical)
Version:5.5.27-ndb-7.2.8-cluster-gpl-log OS:Linux (CentOS release 6.3 (Final) )
Assigned to: CPU Architecture:Any
Tags: Cluster Replication InnoDB ndb_apply_status

[8 Nov 2012 0:13] Paulo Rodrigues
Description:
Hi,

I have an ndb cluster, replicating into two innodb slaves. 
Any update to an ndbcluster table breaks replication, because the update to mysql.ndb_apply_status is converted into an insert, which fails, because it breaks the primary key.

How to repeat:
Insert into any table. Update.

Suggested fix:
It doesn't fail if I drop the ndb_apply_status primary key, but this is certainly not a fix!
Also, the table never gets updated with log_name, start_pos or end_pos.
[8 Nov 2012 0:23] Paulo Rodrigues
Added ndb_error_report to FTP
[8 Nov 2012 0:26] Paulo Rodrigues
this is the binlog of a simple update to a cluster table:

#121107 23:21:41 server id 1  end_log_pos 591  Table_map: `promo_bd`.`logs` mapped to number 64
#121107 23:21:41 server id 1  end_log_pos 653  Table_map: `mysql`.`ndb_apply_status` mapped to number 34
#121107 23:21:41 server id 1  end_log_pos 714  Write_rows: table id 34
#121107 23:21:41 server id 1  end_log_pos 766  Update_rows: table id 64 flags: STMT_END_F
### INSERT INTO mysql.ndb_apply_status
### SET
###   @1=1
###   @2=8756192776028171
###   @3=''
###   @4=0
###   @5=0
### UPDATE promo_bd.logs
### WHERE
###   @1=-67108861 (4227858435)
###   @8=NULL
### SET
###   @1=NULL
###   @8=131865688-35-65 59:25:76
### UPDATE promo_bd.logs
### WHERE
###   @1=0
###   @8=0000-00-05 30:84:16
### SET
###   @1=9
###   @8=16543238-20-76 22:34:88
# at 766

It updates ndb_apply_status trying to insert, which fails
[28 Jun 2017 19:35] MySQL Verification Team
Hi,

verified with 7.5.6 too

all best
Bogdan
[28 Jun 2017 19:39] MySQL Verification Team
Note that replicating mysql.ndb_apply_status to innodb is not very useful so if you are replicating to innodb you might want to avoid it (or you drop key on the slave as you already found out). Anyhow it is a bug IMO so is verified as one.

all best
Bogdan