Crash on replication on foreign key check with redundant indexes

Bug #1705656 reported by Vovan-VE
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona XtraDB Cluster moved to https://jira.percona.com/projects/PXC
New
Undecided
Unassigned

Bug Description

We have multi-master setup with 3 nodes. When 2 nodes (say the currently are slaves) replicates from the other one which accept updates from a client, slaves can crash sometimes.

    [ERROR] Slave SQL: Could not execute Write_rows event on table DB.child; Cannot add
    or update a child row: a foreign key constraint fails (`DB`.`child`,
    CONSTRAINT `fk-child-parent` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`)),
    Error_code: 1452; handler error HA_ERR_NO_REFERENCED_ROW; the event's master log FIRST,
    end_log_pos 204, Error_code: 1452

Crash is not consistent and probably depends from client traffic and/or concurrency.

After some not much proper refactoring a table schema became something like following:

    CREATE TABLE `child` (
      `id` INTEGER(11) NOT NULL AUTO_INCREMENT,
      `parent_id` INTEGER(11) NOT NULL,
      `foobar` INTEGER(11) NOT NULL,
      PRIMARY KEY(`id`),
      KEY `idx-parent_id` (`parent_id`),
      KEY `fk-parent` (`parent_id`, `foobar`),
      CONSTRAINT `fk-child-parent` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`)
    ) ENGINE=InnoDB;

So, in the past there was FK `child`(`parent_id`,`foobar`) => `parent`(`id`,`foobar`).
Later that FK was replaced with FK `child`(`parent_id`) => `parent`(`id`).
And now there is redundant index (`parent_id`,`foobar`).

Look's like the chash did gone after we drop all such redundant indexes.

Affected versions:
* 5.6.35-80.0-56 Percona XtraDB Cluster (GPL), Release rel80.0, Revision 62752df, WSREP version 26.20, wsrep_26.20
* 5.6.36-82.0-56 Percona XtraDB Cluster (GPL), Release rel82.0, Revision de7a681, WSREP version 26.20, wsrep_26.20

Revision history for this message
Vovan-VE (vovan-ve) wrote :

Fail. Still crashing with the same table. Redundant indexes does not matter.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.