Percona XtraDB Cluster - HA scalable solution for MySQL

DELETE FROM (w/o WHERE) crashes slaves if master does not have binlogging enabled

Reported by Alex Yurchenko on 2013-11-22
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MySQL patches by Codership
Status tracked in 5.6
5.5
Undecided
Unassigned
5.6
Critical
Seppo Jaakola
Percona XtraDB Cluster
Status tracked in Trunk
5.6
Undecided
Unassigned
Trunk
Undecided
Unassigned

Bug Description

How to reproduce: on a node with disabled binlog execute:

mysql> CREATE TABLE test.t1 (pk INT AUTO_INCREMENT PRIMARY KEY);
Query OK, 0 rows affected (0.03 sec)

mysql> INSERT INTO test.t1 VALUES(default);
Query OK, 1 row affected (0.01 sec)

// at that point all nodes have the same row in the table

mysql> DELETE FROM test.t1;
Query OK, 1 row affected (0.00 sec)

On slaves you get the following message in the error log:

2013-11-22 23:10:17 14523 [ERROR] Slave SQL: Could not execute Delete_rows event on table test.t1; Can't find record in 't1', Error_code: 1032; handler error HA_ERR_END_OF_FILE; the event's master log FIRST, end_log_pos 141, Error_code: 1032
2013-11-22 23:10:17 14523 [Warning] WSREP: RBR event 3 Delete_rows apply warning: 137, 3
mysqld: /home/ayurchen/codership/mysql/5.6/sql/transaction.cc:42: bool trans_check_state(THD*): Assertion `thd->transaction.stmt.is_empty()' failed.
21:10:17 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.

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

Thread pointer: 0x7f63fc0009a0
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 = 7f64306d0a70 thread_stack 0x40000
/run/shm/galera0/mysql/sbin/mysqld(my_print_stacktrace+0x38)[0xaabc46]
/run/shm/galera0/mysql/sbin/mysqld(handle_fatal_signal+0x3ae)[0x72df6e]
/lib/x86_64-linux-gnu/libpthread.so.0(+0xfbd0)[0x7f643f522bd0]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0x37)[0x7f643e963037]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x148)[0x7f643e966698]
/lib/x86_64-linux-gnu/libc.so.6(+0x2fe03)[0x7f643e95be03]
/lib/x86_64-linux-gnu/libc.so.6(+0x2feb2)[0x7f643e95beb2]
/run/shm/galera0/mysql/sbin/mysqld(_Z17trans_check_stateP3THD+0x63)[0x8ab627]
/run/shm/galera0/mysql/sbin/mysqld(_Z14trans_rollbackP3THD+0x111)[0x8ac27f]
/run/shm/galera0/mysql/sbin/mysqld[0x636712]
/run/shm/galera0/mysql/sbin/mysqld(_Z15wsrep_commit_cbPvjPK14wsrep_trx_metaPbb+0x91)[0x636841]
/run/shm/galera0/galera/lib/libgalera_smm.so(+0x3d0b80)[0x7f643d5d8b80]
/run/shm/galera0/galera/lib/libgalera_smm.so(_ZN6galera13ReplicatorSMM9apply_trxEPvPNS_9TrxHandleE+0x22a)[0x7f643d5db96e]
/run/shm/galera0/galera/lib/libgalera_smm.so(_ZN6galera13ReplicatorSMM11process_trxEPvPNS_9TrxHandleE+0x1c5)[0x7f643d5dff97]
/run/shm/galera0/galera/lib/libgalera_smm.so(_ZN6galera15GcsActionSource8dispatchEPvRK10gcs_actionRb+0x18d)[0x7f643d5bc3dd]
/run/shm/galera0/galera/lib/libgalera_smm.so(_ZN6galera15GcsActionSource7processEPvRb+0xa0)[0x7f643d5bc7b8]
/run/shm/galera0/galera/lib/libgalera_smm.so(_ZN6galera13ReplicatorSMM10async_recvEPv+0x1b1)[0x7f643d5daf2b]
/run/shm/galera0/galera/lib/libgalera_smm.so(galera_recv+0x92)[0x7f643d5f838f]
/run/shm/galera0/mysql/sbin/mysqld[0x637d8a]
/run/shm/galera0/mysql/sbin/mysqld(start_wsrep_THD+0x4ab)[0x61638b]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x7f8e)[0x7f643f51af8e]
/lib/x86_64-linux-gnu/libc.so.6(clone+0x6d)[0x7f643ea26a0d]

Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (0): Connection ID (thread ID): 3
Status: NOT_KILLED

The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.
Writing a core file

Alex Yurchenko (ayurchen) wrote :

not applicable to 5.5 branch

summary: - DELETE FROM crashes slaves if master does not have binlogging enabled
+ DELETE FROM (w/o WHERE) crashes slaves if master does not have
+ binlogging enabled

@Alex,

Is this with UNIV_DEBUG builds that you are facing the crash?

Alex Yurchenko (ayurchen) wrote :

Any build.

Seppo Jaakola (seppo-jaakola) wrote :

If binlog has been disabled, mysqld skips setting all binlog flags.This problem stems from original 5.6 merging.

Fix has been pushed in revision: http://bazaar.launchpad.net/~codership/codership-mysql/5.6/revision/4020
And as following cleanup revision: http://bazaar.launchpad.net/~codership/codership-mysql/5.6/revision/4021
was pushed. This targets also for potential future support for STATEMENT replication.

@Alex, @Seppo,

Thanks for the explanation. I asked because there is another bug reported with similar trace - https://bugs.launchpad.net/codership-mysql/+bug/1234395 Do the above fixes fix that as well?

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

Other bug subscribers