HiveBrain v1.2.0
Get Started
← Back to all entries
patternsqlModerate

Some MySQL slave errors?

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
slavemysqlsomeerrors

Problem


  • Master version: mysql-server-5.5.14-1.el5.remi



  • Slave version: Percona-XtraDB-Cluster-server-5.5.24-23.6.340



  • Binlog format: ROW based



I'm using PRM to setup HA for MySQL.

Sometime, MySQL slave stopped with some errors:

Error executing row event: 'Table 'reportingdb.tvc_ads_tag_date' doesn't exist'


[Warning] Slave SQL: Could not execute Update_rows event on table reportingdb.7k_banner_channel_tmp; Can't find record in '7k_banner_channel_tmp', Error_code: 1032; handler error HA_ERR_KEY_NOT_FOUND; the event's master log mysql-bin.000854, end_log_pos 859094925, Error_code: 1032

120828 0:36:13 [Warning] Slave SQL: Could not execute Write_rows event on table reportingdb.7k_bookings_ver; Duplicate entry '1518' for key 'PRIMARY', Error_code: 1062; handler error HA_ERR_FOUND_DUPP_KEY; the event's master log mysql-bin.001022, end_log_pos 509479, Error_code: 1062

Error 'Error in list of partitions to DROP' on query. Default database: 'reportingdb'. Query: 'ALTER TABLE v3_ban_date_cpm7k DROP PARTITION pcurrent_201298'

and the mysql.sock is missing but the MySQL processes still exist. Pacemaker cannot restart due to the below errors:

InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.


I have to login via TCP (-h 127.0.0.1) and stop MySQL first, then let corosync start MySQL again.

In summary, the question is:

  • How do I solve the above slave errors and prevent them from happening in the


future?

  • Why is the mysql.sock missing? How do I make the Pacemaker better handle this situation?

Solution

It's better not to skip by hundreds. Just loop one-by-one:

until mysql -e "show slave status\G;" | grep -i "Slave_SQL_Running: Yes";do
mysql -e "stop slave; SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1; start slave;";
sleep 1;
done

Context

StackExchange Database Administrators Q#23921, answer score: 11

Revisions (0)

No revisions yet.