start/stop/status scripts don't actually check if running

Bug #1361851 reported by Matthew B
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MySQL Sandbox
Fix Released
Undecided
Unassigned

Bug Description

I created a 1M/2S setup with make_replication_sandbox. I'm testing out MHA and so I did a kill -9 on the master's Pid and safe_mysqld pid.

I then did ~/sandboxes/status_all
This, incorrectly, reported that all 3 nodes were running:

[c_mboehm@test-db3 sandboxes]$ ./status_all
REPLICATION rsandbox_5_5_38
master on
node1 on
node2 on

I did a stop_all to shutdown the slaves and then did start_all to bring them back up and got this:

[c_mboehm@test-db3 sandboxes]$ ./start_all
executing "start" on master
sandbox server already started (found pid file /home/c_mboehm/sandboxes/rsandbox_5_5_38/master/data/mysql_sandbox24193.pid)
 sandbox server started
executing "start" on slave 1
.. sandbox server started
executing "start" on slave 2
. sandbox server started

[c_mboehm@test-db3 sandboxes]$ cat /home/c_mboehm/sandboxes/rsandbox_5_5_38/master/data/mysql_sandbox24193.pid
29683

[c_mboehm@test-db3 sandboxes]$ ps -Af |grep 29683
c_mboehm 23778 10338 0 19:47 pts/0 00:00:00 grep 29683
[c_mboehm@test-db3 sandboxes]$

So seems the status scripts are just checking for the existence of a pid file and not actually checking if that pid exists, or even better would be that a connection to that mysql instance can be ping'd (SELECT 1 etc).

Revision history for this message
Giuseppe Maxia (giuseppe-maxia) wrote :

Thanks for this report. Yes, the status script is too naive. There is a simple fix, which I tested and will be applied soon.

Changed in mysql-sandbox:
status: New → Confirmed
Changed in mysql-sandbox:
status: Confirmed → Fix Released
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.