Bug #66890 Slave server crash after a START SLAVE
Submitted: 20 Sep 2012 13:10 Modified: 20 Sep 2012 23:34
Reporter: Miguel Angel Nieto Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: Replication Severity:S1 (Critical)
Version:5.5.27 OS:Any
Assigned to: CPU Architecture:Any

[20 Sep 2012 13:10] Miguel Angel Nieto
Description:
Seems that the #65740 and #65831 are not fully fixed, I can still crash a MySQL 5.5.27 slave server after a START SLAVE command.

How to repeat:
MASTER my.cnf

[mysqld]
user                            = root
port                            = 5527
socket                          = /tmp/mysql_sandbox5527.sock
basedir                         = /root/5.5.27
datadir                         = /root/sandboxes/msb_5_5_27/data
tmpdir                          = /root/sandboxes/msb_5_5_27/tmp
pid-file                        = /root/sandboxes/msb_5_5_27/data/mysql_sandbox5527.pid
log-error=msandbox.err
server_id=1
log-bin=a

SLAVE my.cnf

[mysqld]
user                            = root
port                            = 5528
socket                          = /tmp/mysql_sandbox5528.sock
basedir                         = /root/5.5.27
datadir                         = /root/sandboxes/msb_5_5_27_slave/data
tmpdir                          = /root/sandboxes/msb_5_5_27_slave/tmp
pid-file                        = /root/sandboxes/msb_5_5_27_slave/data/mysql_sandbox5528.pid
log-error=msandbox.err
replicate-wild-ignore-table=test.%
replicate-ignore-table=mysql.user
server_id=2

Configure a master-slave replication and follow this procedure:

master> create database mytest;
master> use mytest;
master> create table t (i int, a char(10), b char(11));
master> insert into t values (1,'xxx','yyy');
master> update mytest.t set a='xxx',b='yyy',i=@a:=@a+1 where i=1;

then, restart the MASTER:

master> use mytest;
master> update mytest.t set i=1;
master> update mytest.t set a='xxx',b='yyy',i=@a:=@a+1 where i=1;

then, on the SLAVE:

slave> stop slave;
slave> start slave;
slave> show slave status\G
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...

13:08:30 UTC - mysqld got signal 11 ;
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=0
max_threads=151
thread_count=0
connection_count=0
It is possible that mysqld could use up to 
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 338492 K  bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

Thread pointer: 0x2b1f2a0
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 = 7f6736333ea8 thread_stack 0x40000
/root/5.5.27/bin/mysqld(my_print_stacktrace+0x35)[0x79e2d5]
/root/5.5.27/bin/mysqld(handle_fatal_signal+0x403)[0x66e233]
/lib/libpthread.so.0(+0xeff0)[0x7f6745a51ff0]
/lib/libc.so.6(+0x10dd3a)[0x7f6744d28d3a]
/root/5.5.27/bin/mysqld(_ZN5TABLE4initEP3THDP10TABLE_LIST+0x4d)[0x5ed9ad]
/root/5.5.27/bin/mysqld(_Z10open_tableP3THDP10TABLE_LISTP11st_mem_rootP18Open_table_context+0x14e)[0x54152e]
/root/5.5.27/bin/mysqld(_Z11open_tablesP3THDPP10TABLE_LISTPjjP19Prelocking_strategy+0x42b)[0x542d2b]
/root/5.5.27/bin/mysqld(_Z12mysql_updateP3THDP10TABLE_LISTR4ListI4ItemES6_PS4_jP8st_ordery15enum_duplicatesbPySB_+0xb8)[0x5e5268]
/root/5.5.27/bin/mysqld(_Z21mysql_execute_commandP3THD+0x13dd)[0x577bcd]
/root/5.5.27/bin/mysqld(_Z11mysql_parseP3THDPcjP12Parser_state+0x18a)[0x57b03a]
/root/5.5.27/bin/mysqld(_ZN15Query_log_event14do_apply_eventEPK14Relay_log_infoPKcj+0xd5c)[0x71afcc]
/root/5.5.27/bin/mysqld(_Z26apply_event_and_update_posP9Log_eventP3THDP14Relay_log_info+0x125)[0x5166e5]
/root/5.5.27/bin/mysqld[0x51caba]
/root/5.5.27/bin/mysqld(handle_slave_sql+0xaac)[0x51dbfc]
/lib/libpthread.so.0(+0x68ca)[0x7f6745a498ca]
/lib/libc.so.6(clone+0x6d)[0x7f6744cea92d]

Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (2b4f93b): update mytest.t set a='xxx',b='yyy',i=@a:=@a+1 where i=1
Connection ID (thread ID): 1
Status: NOT_KILLED

I'm using the tar.gz mysql-5.5.27-linux2.6-x86_64.tar.gz

Suggested fix:
Is not a fix, but is a workaround.

The workaround is to disable the following parameters:

replicate-wild-ignore-table=test.%
replicate-ignore-table=mysql.user

and then mysql starts to work again.
[20 Sep 2012 17:25] Sveta Smirnova
Thank you for the report.

Verified as described with 5.5.27 MySQL Sandbox, altough crash happened when I executed STOP SLAVE query.
[20 Sep 2012 18:05] MySQL Verification Team
This is probably a duplicate of:

Bug 14597605 - SLAVES CRASHES WITH USER VARIABLES AND REPLICATE-IGNORE-TABLE OPTIONS
[20 Sep 2012 23:34] Sveta Smirnova
This is duplicate of internal Bug# 14597605