Broken FK constraints crashing cluster nodes - assertion in file dict0dict.cc line 564

Bug #1587843 reported by Przemek
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Percona XtraDB Cluster moved to https://jira.percona.com/projects/PXC
Status tracked in 5.6
5.6
Fix Released
High
Unassigned

Bug Description

When doing an UPDATE to a table having many FK constraints, from which some of them are broken - like reference to non existing table, it crashes PXC node (also when cluster has only 1 node active). I cannot reproduce the same on normal Percona Server nor MySQL versions.

[7cf5e9886947] {root} (open) > select @@version,@@version_comment\G
*************************** 1. row ***************************
        @@version: 5.6.29-76.2-56-log
@@version_comment: Percona XtraDB Cluster (GPL), Release rel76.2, Revision b60e98d, WSREP version 25.15, wsrep_25.15
1 row in set (0.00 sec)

[7cf5e9886947] {root} (open) > UPDATE lms_activities SET activity_provider_id = 19 WHERE activity_id = 611;
ERROR 1452 (23000): Cannot add or update a child row: a foreign key constraint fails (`okn_lil_main`.`lms_activities`, CONSTRAINT `lms_activities_ibfk_5` FOREIGN KEY (`activity_provider_id`) REFERENCES `lms_providers` (`provider_id`) ON DELETE SET NULL ON UPDATE CASCADE)
[7cf5e9886947] {root} (open) > UPDATE lms_activities SET activity_provider_id = 19 WHERE activity_id = 611;
ERROR 2013 (HY000): Lost connection to MySQL server during query

2016-05-31 13:29:57 7f5390b0a700 InnoDB: Assertion failure in thread 139996886509312 in file dict0dict.cc line 564
InnoDB: Failing assertion: table->n_ref_count > 0
InnoDB: We intentionally generate a memory trap.
InnoDB: Submit a detailed bug report to http://bugs.mysql.com.
InnoDB: If you get repeated assertion failures or crashes, even
InnoDB: immediately after the mysqld startup, there may be
InnoDB: corruption in the InnoDB tablespace. Please refer to
InnoDB: http://dev.mysql.com/doc/refman/5.6/en/forcing-innodb-recovery.html
InnoDB: about forcing recovery.
13:29:57 UTC - mysqld got signal 6 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
We will try our best to scrape up some info that will hopefully help
diagnose the problem, but since we have already crashed,
something is definitely wrong and this may fail.
Please help us make Percona XtraDB Cluster better by reporting any
bugs at https://bugs.launchpad.net/percona-xtradb-cluster

key_buffer_size=25165824
read_buffer_size=131072
max_used_connections=1
max_threads=202
thread_count=6
connection_count=1
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 105041 K bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

Thread pointer: 0x2254610
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 7f5390b09d68 thread_stack 0x40000
/usr/sbin/mysqld(my_print_stacktrace+0x35)[0x907585]
/usr/sbin/mysqld(handle_fatal_signal+0x4b4)[0x66b804]
/lib64/libpthread.so.0(+0xf7e0)[0x7f53cfbfb7e0]
/lib64/libc.so.6(gsignal+0x35)[0x7f53cde36625]
/lib64/libc.so.6(abort+0x175)[0x7f53cde37e05]
/usr/sbin/mysqld[0xaed394]
/usr/sbin/mysqld[0xa63033]
/usr/sbin/mysqld[0xa64e79]
/usr/sbin/mysqld[0xa6533a]
/usr/sbin/mysqld[0xa4809b]
/usr/sbin/mysqld[0x9b6d0f]
/usr/sbin/mysqld(_ZN7handler13ha_update_rowEPKhPh+0x112)[0x5ae832]
/usr/sbin/mysqld(_Z12mysql_updateP3THDP10TABLE_LISTR4ListI4ItemES6_PS4_jP8st_ordery15enum_duplicatesbPySB_+0x13fa)[0x76988a]
/usr/sbin/mysqld(_Z21mysql_execute_commandP3THD+0x2981)[0x6f3e11]
/usr/sbin/mysqld(_Z11mysql_parseP3THDPcjP12Parser_state+0x628)[0x6f87f8]
/usr/sbin/mysqld[0x6f8992]
/usr/sbin/mysqld(_Z16dispatch_command19enum_server_commandP3THDPcj+0x1896)[0x6fabc6]
/usr/sbin/mysqld(_Z10do_commandP3THD+0x22b)[0x6fc47b]
/usr/sbin/mysqld(_Z24do_handle_one_connectionP3THD+0x17f)[0x6c2c7f]
/usr/sbin/mysqld(handle_one_connection+0x47)[0x6c2e67]
/lib64/libpthread.so.0(+0x7aa1)[0x7f53cfbf3aa1]
/lib64/libc.so.6(clone+0x6d)[0x7f53cdeec93d]

Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (7f536c004b90): is an invalid pointer
Connection ID (thread ID): 6
Status: NOT_KILLED

Reproducible always after second try of the statement. Schema and data for test case confidential.

Tags: i69694
Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PXC-1028

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.