Crash on replication on foreign key check with redundant indexes
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_
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`
Later that FK was replaced with FK `child`
And now there is redundant index (`parent_
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
Fail. Still crashing with the same table. Redundant indexes does not matter.