pt-slave-delay causes errors if slave is stopped with an error

Reported by Mrten on 2012-02-10
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Toolkit
Undecided
Unassigned

Bug Description

If the slave pt-slave-delay runs on stops with an replication error, for example when a table does not exist, every time pt-slave-delay tries to restart the slave there are errors logged:

Feb 10 21:58:28 rinske mysqld: 120210 21:58:28 [Note] Slave SQL thread initialized, starting replication in log 'mysql-bin.004782' at position 206803715, relay log '/var/log/mysql/mysqld-relay-bin.002046' position: 206803860
Feb 10 21:58:28 rinske mysqld: 120210 21:58:28 [ERROR] Slave SQL: Error 'Table 'scratch0.afval_agenda' doesn't exist' on query. Default database: 'afval'. Query: 'update afval.afval_agenda left join scratch0.afval_agenda using (agendaid) set afval.afval_agenda.afloop = scratch0.afval_agenda.afloop', Error_code: 1146
Feb 10 21:58:28 rinske mysqld: 120210 21:58:28 [Warning] Slave: Table 'scratch0.afval_agenda' doesn't exist Error_code: 1146
Feb 10 21:58:28 rinske mysqld: 120210 21:58:28 [ERROR] Error running query, slave SQL thread aborted. Fix the problem, and restart the slave SQL thread with "SLAVE START". We stopped at log 'mysql-bin.004782' position 206803715

Could pt-slave-delay possibly check Last_Errno from SHOW SLAVE STATUS before restarting the slave thread?

I run pt-slave-delay like this:

pt-slave-delay --delay 60m --interval 5m --defaults-file=/etc/mysql/debian.cnf --daemonize --pid=/var/run/pt-slave-delay.pid

root@rinske:/var/log# pt-slave-delay --version
pt-slave-delay 2.0.2

mysql> SHOW VARIABLES LIKE "%version%";
+-------------------------+--------------------------------------------+
| Variable_name | Value |
+-------------------------+--------------------------------------------+
| innodb_version | 1.0.17-rel13.1 |
| protocol_version | 10 |
| version | 5.1.60-rel13.1-log |
| version_comment | (Percona Server (GPL), 13.1, Revision 413) |
| version_compile_machine | x86_64 |
| version_compile_os | debian-linux-gnu |
+-------------------------+--------------------------------------------+
6 rows in set (0.00 sec)

tags: added: pt-slave-delay
tags: added: crash
Changed in percona-toolkit:
status: New → Triaged
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers