Bug #72490 innodb+ memcache not working on master - slave replication
Submitted: 30 Apr 2014 11:40 Modified: 23 May 2014 10:06
Reporter: rajnish kumar Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S1 (Critical)
Version:5.6.16-log OS:Linux (innodb+ memcache not working on master - slave replication)
Assigned to: CPU Architecture:Any
Tags: Mysql(Innodb +Memcache enabled )Crashed when enable innodb_api_enable_binlog

[30 Apr 2014 11:40] rajnish kumar
Description:
Hi team,
I start using mysql 5.6 for innodb_memcache plugins , everything is working fine till I configured master-slave replication.
two things puzzle me while configured it with master-slave.
Note below are lines which I enabled for memcache in my.cnf
daemon_memcached_w_batch_size=25
daemon_memcached_option='-v -m 1048'
point 1 . when i am not using innodb_api_enable_binlog=1 in my.cnf
insert / update through memcache prompt (telnet localhost 11211) innodb_memcache table doesnot replicated,but saved in table(access through memcache prompt/sql prompt).
when i am doing this thing from sql prompt everything works fine ,data get replicated.
don't knew how mysql replicate data without save it in binary logs.
Point 2 .
when i enable innodb_api_enable_binlog=1 in my.cnf
insert record from sql / memcache prompt all replicated to slave server,but problem is when i am updating records using memcache prompt it throws below error.
Connection closed by foreign host.
 and data doesnot save in table .

now i dont know what to do, as i am plan to using mysql 5.6 in production but due to this problem i am unable to do this up gradation.

How to repeat:
Hi team,
enable innodb_memcahe plugin (with and without innodb_api_enable_binlog) then configure master-slave replication then try to insert update records .
[19 May 2014 12:36] rajnish kumar
Hi team,
i tried few changed in my.cnf but still facing same issue ,below changed I made.
daemon_memcached_w_batch_size=1
daemon_memcached_option='-vvv -m 1048'

when i used -vvv instead -v i got error in mysql error log and found mysql was restarted ,below are error log details .

 set 37ASDFGGTTY50 0 0 15
107: going from conn_parse_cmd to conn_nread
107 - Running task: (conn_nread)
107 - Running task: (conn_nread)
107 - Running task: (conn_nread)
12:35:03 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.
[19 May 2014 12:37] rajnish kumar
making it critical issue
[22 May 2014 10:41] rajnish kumar
Following test Cases I tried 

O.S - CentOS release 6.5 
MySQL Version- 5.6.16

MySQL installed on two machine (mac1 & mac2)

Case 1:  Without Replication 
my.cnf
#memcache
#innodb_api_enable_binlog=1
No Replication Configured 

Insert new records through  memcache prompt -- working fine , 
update records using set through  memcache prompt -- working fine 
Replication -- Not Working (obvious)

Case 2:  With Replication  and without innodb_api_enable_binlog 
my.cnf
#memcache
#innodb_api_enable_binlog=1

Replication Configured between mac1(Master)--> mac2(Slave)
Insert new records through  memcache prompt -- working fine  
Replication -- Not Working
update records using set through  memcache prompt -- working fine 
Replication -- Not Working
Insert new records through  MySQL prompt -- working fine 
Replication -- Working

Case 3:  With Replication  with innodb_api_enable_binlog
my.cnf
#memcache
innodb_api_enable_binlog=1

Replication Configured between  mac1(Master)--> mac2(Slave)

Insert new records through  memcache prompt -- working fine  
Replication --  Working
update records using set through  memcache prompt -- MySQL Crashed
Replication -- Not Working
Insert new records through  MySQL prompt -- working fine ,  
Replication -- Working
Updating records through  MySQL prompt -- working fine ,  
Replication -- Working
[22 May 2014 10:44] rajnish kumar
adding relevant tag Mysql(Innodb +Memcache enabled )Crashed when enable innodb_api_enable_binlog
[23 May 2014 10:06] rajnish kumar
Finally I found solution for it .
few things should be remember when using innodb table with memcache plugin.

when we create innodb table which are going to used through memcache, we keep 3 more columns for memcache parameter, like if we want to create a table with 3 column to save our information so we have to keep 3 more columns for memcache plugins so we create table with 6 columns ( 3 to sotre values + 3 column (data type should be integer) for make entry in memcache container table ,it is fixed).

when we insert records in innodb_memcache.containers ,use these 3 extra column here ,below are details .

Note: 3 extra column named c1,c2,c3 data type should be int.

so we insert records in containers table as below flags: c1
cas_column: c2
expire_time_column: c3

after setting this now my MySQL doesnot crashed and it is working fine.