"rpl.rpl_start_stop_slave" fail sporadically on 5.5

Bug #1578303 reported by Yura Sorokin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MySQL Server
Unknown
Unknown
Percona Server moved to https://jira.percona.com/projects/PS
Status tracked in 5.7
5.5
Fix Released
Low
Yura Sorokin
5.6
Invalid
Low
Yura Sorokin
5.7
Invalid
Low
Yura Sorokin

Bug Description

Tested on CentOS 7 x64 with Percona Server 5.5.48

******************************************************************************************************************
rpl.rpl_start_stop_slave 'stmt' w2 [ fail ]
        Test ended at 2016-05-02 09:10:27

CURRENT_TEST: rpl.rpl_start_stop_slave
mysqltest: At line 30: query 'kill $connection_id' failed: 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1

The result from queries just before the failure was:
include/master-slave.inc
[connection master]
set @time_before_kill := (select CURRENT_TIMESTAMP);
[Time before the query]
[Connection ID of the slave I/O thread found]
******************************************************************************************************************

The probability of a failure is much higher when release binaries are used.
To reproduce, run the following
./mtr rpl.rpl_start_stop_slave rpl.rpl_start_stop_slave rpl.rpl_start_stop_slave rpl.rpl_start_stop_slave rpl.rpl_start_stop_slave rpl.rpl_start_stop_slave rpl.rpl_start_stop_slave rpl.rpl_start_stop_slave --repeat=32 --parallel=8

Tags: ci upstream
Revision history for this message
Yura Sorokin (yura-sorokin) wrote :

The problem seems to be in
--let $connection_id=`SELECT id FROM information_schema.processlist where state LIKE 'Waiting for master to send event'`

At this point slave connection may still be in 'Queueing master event to the relay log' state and therefore $connection_id can be empty.

To fix, we need to make sure that there is at least 1 connection with status 'Waiting for master to send event' before reading its id.
"wait_condition.inc" can be used for this.

************************************************************************************************************************
let $wait_condition= SELECT COUNT(*) = 1 FROM information_schema.processlist WHERE state LIKE 'Waiting for master to send event';
--source include/wait_condition.inc
--let $connection_id=`SELECT id FROM information_schema.processlist where state LIKE 'Waiting for master to send event'`
************************************************************************************************************************

Changed in percona-server:
importance: Medium → Low
tags: added: upstream
tags: added: ci
Revision history for this message
Yura Sorokin (yura-sorokin) wrote :
no longer affects: percona-server/upstream-5.5
Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PS-2145

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.