mysql> show slave status \G;
*************************** 1. row ***************************
Slave_IO_State:
Master_Host: 192.168.0.8
Master_User: repl
Master_Port: 3388
Connect_Retry: 60
Master_Log_File: mysql-bin.000011
Read_Master_Log_Pos: 1065003654
Relay_Log_File: db3388-relay-bin.000002
Relay_Log_Pos: 3568906
Relay_Master_Log_File: mysql-bin.000011
Slave_IO_Running: Yes
Slave_SQL_Running: No
Replicate_Do_DB:
Replicate_Ignore_DB:
Replicate_Do_Table:
Replicate_Ignore_Table:
Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table:
Last_Errno: 1032
Last_Error: Could not execute Update_rows event on table appak.user_cpinfo; Can't find record in 'user_cpinfo', Error_code: 1032; handler error HA_ERR_KEY_NOT_FOUND; the event's master log mysql-bin.000011, end_log_pos 67290756
Skip_Counter: 0
Exec_Master_Log_Pos: 67290539
Relay_Log_Space: 1001282779
Until_Condition: None
Until_Log_File:
Until_Log_Pos: 0
Master_SSL_Allowed: No
Master_SSL_CA_File:
Master_SSL_CA_Path:
Master_SSL_Cert:
Master_SSL_Cipher:
Master_SSL_Key:
Seconds_Behind_Master: NULL
Master_SSL_Verify_Server_Cert: No
Last_IO_Errno: 0
Last_IO_Error:
Last_SQL_Errno: 1032
Last_SQL_Error: Could not execute Update_rows event on table appak.user_cpinfo; Can't find record in 'user_cpinfo', Error_code: 1032; handler error HA_ERR_KEY_NOT_FOUND; the event's master log mysql-bin.000011, end_log_pos 67290756
1 row in set (0.00 sec)
由于没有打开log_slave_updates
因此看中继日志
# /usr/local/mysql/bin/mysqlbinlog db3388-relay-bin.000002 --base64-output=decode-rows -v > decoded.log
查找对应POS,发现是这么一条SQL操作:
/*!*/;
# at 3568906
#100903 9:34:42 server id 1 end_log_pos 67290614 Query thread_id=149146 exec_time=0 error_code=0
SET TIMESTAMP=1283477682/*!*/;
BEGIN
/*!*/;
# at 3568981
# at 3569047
#100903 9:34:42 server id 1 end_log_pos 67290680 Table_map: `appak`.`user_cpinfo` mapped to number 227
#100903 9:34:42 server id 1 end_log_pos 67290756 Update_rows: table id 227 flags: STMT_END_F
### UPDATE appak.user_cpinfo
### WHERE
### @1=10739087
### @2=6261683
### @3=5918
### @4=41987
### @5=5
### @6=1283477681
### @7=0
### SET
### @1=10739087
### @2=6261683
### @3=5918
### @4=41987
### @5=5
### @6=1283477681
### @7=1
# at 3569123
#100903 9:34:42 server id 1 end_log_pos 67290832 Query thread_id=149146 exec_time=0 error_code=0
SET TIMESTAMP=1283477682/*!*/;
COMMIT
但是开发那边说这对appak.user_cpinfo只有INSERT操作,而不会有UPDATE操作。
问题未解决,同步失效。
两边binlog_format都是MIXED。appak.user_cpinfo的存储引擎是MyISAM。。。很诡异。
这会是什么问题?谢谢。