Foreign constraint error on one slave
Bug #1254149 reported by
monty solomon
This bug report is a duplicate of:
Bug #1239958: IO thread on crash safe replication uses older binary coordinates after slave server restarts after a crash.
Edit
Remove
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Percona Server moved to https://jira.percona.com/projects/PS |
New
|
Undecided
|
Unassigned |
Bug Description
One slave of a pair of slaves experienced replication failure due to a foreign key constraint error.
One of three slaves was promoted to be the master a few hours earlier.
Changed in percona-server: | |
status: | Incomplete → New |
To post a comment you must log in.
Here are excerpts from the error.log file.
131122 4:21:42 [Note] /usr/sbin/mysqld: ready for connections. dbprod/ xxxxx-p0. sock' port: 3306 Percona Server (GPL), Release rel31.1, Revision 566
Version: '5.5.33-31.1-log' socket: '/opt/mysql/
131122 4:21:43 [Note] Slave SQL thread initialized, starting replication in log 'bin.000001' at position 4, relay log '/opt/mysql/ dblogs1/ xxxxx-p0/ relay/relay. 000002' position: 4
131122 4:21:43 [Note] Slave I/O thread: connected to master 'SUSR_Repl@ yyyyy:3306' ,replication started in log 'bin.000001' at position 4
131122 7:17:02 [ERROR] Slave SQL: Could not execute Write_rows event on table xxxxx.userAttri butes; Cannot add or update a child row: a foreign key constraint fails (`xxxxx` .`userAttribute s`, CONSTRAINT `userAttributes _ibfk_1` FOREIGN KEY (`userId`) REFERENCES `users` (`ID`) ON DELETE CASCADE), Error_code: 1452; handler error HA_ERR_ NO_REFERENCED_ ROW; the event's master log bin.000003, end_log_pos 15527775, Error_code: 1452
131122 7:17:02 [Warning] Slave: Cannot add or update a child row: a foreign key constraint fails (`xxxxx` .`userAttribute s`, CONSTRAINT `userAttributes _ibfk_1` FOREIGN KEY (`userId`) REFERENCES `users` (`ID`) ON DELETE CASCADE) Error_code: 1452
131122 7:17:02 [ERROR] Error running query, slave SQL thread aborted. Fix the problem, and restart the slave SQL thread with "SLAVE START". We stopped at log 'bin.000003' position 15527524