Row Event Order in Binary Log Causes Duplicate Key Error in MySQL Cluster not using Deferred Constraints (Doc ID 1380804.1)

Last updated on JANUARY 05, 2015

Applies to:

MySQL Cluster - Version 7.1 and later
Information in this document applies to any platform.

Symptoms

On : 7.1.10 version of MySQL Cluster using Replication, when attempting to update the primary key of an NDB table, the following error may occur on the slave.

ERROR
-----------------------
Last_Errno: 1022
Last_Error: Error 'Can't write; duplicate key in table ''' on query. Default database: ''. Query: 'COMMIT'


STEPS
-----------------------
The issue can be reproduced at will with the following steps:
1. Create a table with a primary key and a unique key field and populate one row.
2. Update a row to set the primary key to +1 its value.
3. Update a row to set the primary key back (-1) value.
4. When binlog is used on slave (or piped through mysql client) it will fail on the second update.

BUSINESS IMPACT
-----------------------
The issue has the following business impact:
Due to this issue, users cannot get consistent error reporting and replication stops functioning.

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms