Merge lp:~tplavcic/percona-server/ps-bld-228-5.5 into lp:percona-server/5.5

Proposed by Tomislav Plavcic on 2014-12-05
Status: Merged
Approved by: Laurynas Biveinis on 2014-12-09
Approved revision: 699
Merged at revision: 720
Proposed branch: lp:~tplavcic/percona-server/ps-bld-228-5.5
Merge into: lp:percona-server/5.5
Diff against target: 22 lines (+8/-2)
1 file modified
build-ps/debian/percona-server-server-5.5.mysql.init (+8/-2)
To merge this branch: bzr merge lp:~tplavcic/percona-server/ps-bld-228-5.5
Reviewer Review Type Date Requested Status
Laurynas Biveinis (community) 2014-12-05 Approve on 2014-12-09
Review via email: mp+243776@code.launchpad.net

Description of the change

Debian init script (start) has hardcoded wait for 14sec and if the server is not pingable in that time it fails - which is not good in some cases.
Change has been made to wait forever and exit if server responds to ping and also after first 10 sec start to check for pid also and if it doesn't exists then we assume server died and fail.

Testing has been done for 5.5 and 5.6 using packages from main repo and just replaced with the new init script.

PS 5.5 - ubuntu 14.04
= looks ok
=====================
vagrant@t-ubuntu14:~$ sudo /etc/init.d/mysql start
 * Starting MySQL (Percona Server) database server mysqld
   ...done.
 * Checking for corrupt, not cleanly closed and upgrade needing tables.
vagrant@t-ubuntu14:~$ mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 37
Server version: 5.5.40-36.1 Percona Server (GPL), Release 36.1, Revision 707

Copyright (c) 2009-2014 Percona LLC and/or its affiliates
Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> quit;
Bye
vagrant@t-ubuntu14:~$ sudo /etc/init.d/mysql stop
 * Stopping MySQL (Percona Server) mysqld
   ...done.

PS 5.5 - ubuntu 14.04 - simulated server not started by commenting mysqld_safe
= script waited 10 sec to check for pid and then failed
==============================================================================
vagrant@t-ubuntu14:~$ sudo /etc/init.d/mysql start
 * Starting MySQL (Percona Server) database server mysqld
   ...fail!
vagrant@t-ubuntu14:~$ mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

PS 5.6 - ubuntu 14.04
= looks ok
=====================
vagrant@t-ubuntu14:~$ sudo /etc/init.d/mysql start
 * Starting MySQL (Percona Server) database server mysqld
   ...done.
 * Checking for corrupt, not cleanly closed and upgrade needing tables.
vagrant@t-ubuntu14:~$ mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 45
Server version: 5.6.21-70.1 Percona Server (GPL), Release 70.1, Revision 698

Copyright (c) 2009-2014 Percona LLC and/or its affiliates
Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> quit;
Bye
vagrant@t-ubuntu14:~$ sudo /etc/init.d/mysql stop
 * Stopping MySQL (Percona Server) mysqld
   ...done.

PS 5.6 - ubuntu 14.04 - simulated server not started by commenting mysqld_safe
= script waited 10 sec to check for pid and then failed
==============================================================================
vagrant@t-ubuntu14:~$ sudo /etc/init.d/mysql start
 * Starting MySQL (Percona Server) database server mysqld
   ...fail!
vagrant@t-ubuntu14:~$ mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

To post a comment you must log in.

Looks good, holding off the merge until 5.1 is cleared

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'build-ps/debian/percona-server-server-5.5.mysql.init'
2--- build-ps/debian/percona-server-server-5.5.mysql.init 2012-09-18 04:57:16 +0000
3+++ build-ps/debian/percona-server-server-5.5.mysql.init 2014-12-05 10:44:25 +0000
4@@ -105,10 +105,16 @@
5 log_end_msg 0
6 else
7 "${PERCONA_PREFIX}"/bin/mysqld_safe > /dev/null 2>&1 &
8- # 6s was reported in #352070 to be too few when using ndbcluster
9- for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14; do
10+ dead_check_counter=0
11+ while true; do
12 sleep 1
13 if mysqld_status check_alive nowarn ; then break; fi
14+ # wait 10sec before start checking if pid file created or server is dead
15+ if [ $dead_check_counter -lt 10 ]; then
16+ dead_check_counter=$(( dead_check_counter + 1 ))
17+ else
18+ if mysqld_status check_dead nowarn; then break; fi
19+ fi
20 log_progress_msg "."
21 done
22 if mysqld_status check_alive warn; then

Subscribers

People subscribed via source and target branches