mysqld_safe does not correctly parse flush_caches and numa_interleave options

Bug #1231110 reported by Ovais Tariq on 2013-09-25
18
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Percona Server
Status tracked in 5.6
5.1
Undecided
Unassigned
5.5
Medium
Sergei Glushchenko
5.6
Medium
Sergei Glushchenko

Bug Description

Setting the below options to any value disables them:

[mysqld_safe]
flush_caches = yes
numa_interleave = yes

OR

[mysqld_safe]
flush_caches = 1
numa_interleave = 1

This is contrary to the variable being mentioned as a "boolean" variable in the documentation and with the range of values shown as "0/1":
http://www.percona.com/doc/percona-server/5.5/performance/innodb_numa_support.html

Related branches

lp:~sergei.glushchenko/percona-server/5.5-ps-bug1231110
Merged into lp:percona-server/5.5 at revision 640
Alexey Kopytov: Approve on 2014-03-17
lp:~sergei.glushchenko/percona-server/5.6-ps-bug1231110
Merged into lp:percona-server at revision 561
Alexey Kopytov: Approve on 2014-03-17

It seems the only way to use these options is to pass them like --numa_interleave and --flush_caches (without arguments) to mysqld_safe at the command line.

Verified by code review of mysqld_safe.sh:

...
      --syslog-tag=*) syslog_tag="$val" ;;
      --timezone=*) TZ="$val"; export TZ; ;;
      --flush-caches) flush_caches=1 ;;
      --numa-interleave) numa_interleave=1 ;;
...

and tests on recent PS 5.5 and 5.6.

Alexey Kopytov (akopytov) wrote :

The workaround is to put the options without any value into my.cnf:

[mysqld_safe]
flush_caches
numa_interleave

And the fix is:

--- Percona-Server/scripts/mysqld_safe.sh 2013-02-18 04:48:10 +0000
+++ Percona-Server/scripts/mysqld_safe.sh 2013-09-26 11:31:44 +0000
@@ -232,8 +232,8 @@ parse_arguments() {
       --skip-syslog) want_syslog=0 ;;
       --syslog-tag=*) syslog_tag="$val" ;;
       --timezone=*) TZ="$val"; export TZ; ;;
- --flush-caches) flush_caches=1 ;;
- --numa-interleave) numa_interleave=1 ;;
+ --flush-caches=*) flush_caches="$val" ;;
+ --numa-interleave=*) numa_interleave="$val" ;;

       --help) usage ;;

tags: added: low-hanging-fruit
removed: doc
markus_albe (markus-albe) wrote :

There is some part of this which is not fixed, because the "mysql" user can't start with

[root@percona1 ~]# cat /etc/my.cnf |egrep "flush|numa"
flush_caches=1
numa_interleave=1

[root@percona1 ~]# id
uid=0(root) gid=0(root) groups=0(root)

[root@percona1 ~]# /etc/init.d/mysql start
Starting MySQL (Percona Server)..... SUCCESS!

[root@percona1 ~]# /etc/init.d/mysql stop
Shutting down MySQL (Percona Server)... SUCCESS!

[root@percona1 ~]# su - mysql

# as "mysql" user:

-bash-4.1$ cat /etc/my.cnf |egrep "flush|numa"
flush_caches=1
numa_interleave=1

-bash-4.1$ id
uid=497(mysql) gid=498(mysql) groups=498(mysql)

-bash-4.1$ /etc/init.d/mysql stop
 ERROR! MySQL (Percona Server) PID file could not be found!

-bash-4.1$ /etc/init.d/mysql start
Starting MySQL (Percona Server). ERROR! The server quit without updating PID file (/var/lib/mysql/percona1.pid).

-bash-4.1$ logout
[root@percona1 ~]# vi /etc/my.cnf
[root@percona1 ~]# cat /etc/my.cnf |egrep "flush|numa"
flush_caches
numa_interleave

[root@percona1 ~]# id
uid=0(root) gid=0(root) groups=0(root)

[root@percona1 ~]# /etc/init.d/mysql start
Starting MySQL (Percona Server)..... SUCCESS!

[root@percona1 ~]# /etc/init.d/mysql stop
Shutting down MySQL (Percona Server).. SUCCESS!

# as mysql user; now succeeds:
[root@percona1 ~]# su - mysql

-bash-4.1$ /etc/init.d/mysql start
Starting MySQL (Percona Server).. SUCCESS!
-bash-4.1$

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

Other bug subscribers