Bug #72704 Memcache with replication cause mysql to crash when setting same key twice
Submitted: 21 May 2014 8:13 Modified: 18 Aug 2014 8:23
Reporter: Srinivasa Bora Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server Severity:S1 (Critical)
Version:5.6.16 OS:Linux
Assigned to: CPU Architecture:Any
Tags: Memcache, replication, Signal 11

[21 May 2014 8:13] Srinivasa Bora
Description:
08:05:20 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=1048576
max_used_connections=2
max_threads=5
thread_count=4
connection_count=1
It is possible that mysqld could use up to 
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 18500 K  bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

Thread pointer: 0x7fca44006790
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 = 7fca6e1fab08 thread_stack 0x40000
/u01/app/mysql/product/5.6.16/bin/mysqld(my_print_stacktrace+0x35)[0x903575]
/u01/app/mysql/product/5.6.16/bin/mysqld(handle_fatal_signal+0x3e8)[0x66fdd8]
/lib64/libpthread.so.0[0x39ab60f710]
/u01/app/mysql/product/5.6.16/lib/plugin//innodb_engine.so(handler_rec_setup_int+0x30)[0x7fca7402afe0]
/u01/app/mysql/product/5.6.16/lib/plugin//innodb_engine.so(+0xbceb)[0x7fca74027ceb]
/u01/app/mysql/product/5.6.16/lib/plugin//innodb_engine.so(innodb_api_store+0x209)[0x7fca74028fb9]
/u01/app/mysql/product/5.6.16/lib/plugin//innodb_engine.so(+0x9bd4)[0x7fca74025bd4]
/u01/app/mysql/product/5.6.16/lib/plugin/libmemcached.so(conn_nread+0xea7)[0x7fcac2519717]
/u01/app/mysql/product/5.6.16/lib/plugin/libmemcached.so(+0xb25e)[0x7fcac250e25e]
/u01/app/mysql/product/5.6.16/lib/plugin/libmemcached.so(event_base_loop+0x379)[0x7fcac251e239]
/u01/app/mysql/product/5.6.16/lib/plugin/libmemcached.so(+0x18af2)[0x7fcac251baf2]
/lib64/libpthread.so.0[0x39ab6079d1]
/lib64/libc.so.6(clone+0x6d)[0x39ab2e8b6d]

Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (0): Connection ID (thread ID): 8
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.
140521 01:05:20 mysqld_safe Number of processes running now: 0
140521 01:05:20 mysqld_safe mysqld restarted

How to repeat:
set innodb_api_enable_binlog=1
Master to Master replication
telnet to memcache
set same key twice.
[18 Jul 2014 8:23] MySQL Verification Team
Thank you for the report.
I could not reproduce this issue with latest build 5.7.4.
With a setup MasterA<->MasterB with memcacheA session, or both memcacheA/memcacheB active and updating same key.

MasterA:

mysql> select * from demo_test;
+-------+--------------+------+------+------------+
| c1    | c2           | c3   | c4   | c5         |
+-------+--------------+------+------+------------+
| AA    | HELLO, HELLO |    8 |    0 |          0 |
| k     | 1            |    0 |   18 | 1405811048 |
| key   | 1            |    0 |    4 |          0 |
| test1 | t1           |   10 |    4 |          0 |
+-------+--------------+------+------+------------+
4 rows in set (0.00 sec)

MasterB:

mysql> select * from demo_test;
+-------+--------------+------+------+------------+
| c1    | c2           | c3   | c4   | c5         |
+-------+--------------+------+------+------------+
| AA    | HELLO, HELLO |    8 |    0 |          0 |
| k     | 1            |    0 |   18 | 1405811048 |
| key   | 1            |    0 |    4 |          0 |
| test1 | t1           |   10 |    4 |          0 |
+-------+--------------+------+------+------------+
4 rows in set (0.00 sec)

Could you please try with the 5.6.19 or 5.7.4 and also provide exact conf file used, repeatable test cases(set command used etc).

Thanks,
Umesh
[19 Aug 2014 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".