Percona XtraDB Cluster - HA scalable solution for MySQL

stopping mysql with inet script doesn't work if pid-file is provided as pid_file in my.cnf

Reported by Frederic Descamps on 2013-08-06
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
MySQL Server
Unknown
Unknown
Percona Server
Status tracked in 5.6
5.1
Medium
Unassigned
5.5
Medium
Unassigned
5.6
Medium
Unassigned
Percona XtraDB Cluster
Medium
Raghavendra D Prabhu

Bug Description

When you define the pid-file in my.cnf using (underscore) instead of -, it won't stop.

in my.cnf:

pid_file = /mysql/data/mysql.pid

mysqld print-defaults output:

mysqld --print-defaults
mysqld would have been started with the following arguments:
--user=mysql --default_storage_engine=InnoDB --socket=/mysql/data/mysql.sock --pid_file=/mysql/data/mysql.pid
 [...]
--wsrep_sst_donor=db1

mysqld --print-defaults \
> | tr " " "\n" \
> | grep -- "--pid-file" \
> | tail -n 1 \
> | cut -d= -f2

---> nothing

mysqld --print-defaults \
> | tr " " "\n" \
> | grep -- "--pid_file" \
> | tail -n 1 \
> | cut -d= -f2
/mysql/data/mysql.pid

Changed in percona-xtradb-cluster:
status: New → Fix Committed
assignee: nobody → Raghavendra D Prabhu (raghavendra-prabhu)
importance: Undecided → Medium
milestone: none → 5.5.32-23.7.6
Changed in percona-xtradb-cluster:
status: Fix Committed → Fix Released

Percona Server 5.1 and 5.6 are also affected:

[openxs@chief ~]$ cd /tmp/Percona-Server-5.1.72-rel14.10
[openxs@chief Percona-Server-5.1.72-rel14.10]$ grep -- --pid-file support-files/mysql.server.sh
      --pid-file=*) server_pid_file=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
      --pid-file=*) pid_file=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
        --pid-file="$pid_file" >/dev/null 2>&1 &
      $bindir/mysqld_safe --datadir=$datadir --pid-file=$server_pid_file $other_args >/dev/null 2>&1 &
[openxs@chief Percona-Server-5.1.72-rel14.10]$ grep -- --pid_file support-files/mysql.server.sh

[openxs@chief Percona-Server-5.6.14-rel62.0]$ grep -- --pid_file support-files/mysql.server.sh
[openxs@chief Percona-Server-5.6.14-rel62.0]$ grep -- --pid-file support-files/mysql.server.sh
      --pid-file=*) mysqld_pid_file_path=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
      $bindir/mysqld_safe --datadir="$datadir" --pid-file="$mysqld_pid_file_path" $other_args >/dev/null 2>&1 &

This is what we see in current cluster code (with the fix, I assume):

[openxs@chief percona-xtradb-cluster]$ bzr version-info
revision-id: <email address hidden>
date: 2013-12-03 17:43:41 +0100
build-date: 2013-12-04 13:03:18 +0200
revno: 590
branch-nick: percona-xtradb-cluster
[openxs@chief percona-xtradb-cluster]$ grep -- --pid-file Percona-Server/support-files/mysql.server.sh
      --pid-file=*|--pid_file=*) mysqld_pid_file_path=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
      $bindir/mysqld_safe --datadir="$datadir" --pid-file="$mysqld_pid_file_path" $other_args >/dev/null 2>&1 &

tags: added: upstream
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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