mysqld_safe does not correctly parse flush_caches and numa_interleave options

Bug #1231110 reported by Ovais Tariq
18
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Percona Server moved to https://jira.percona.com/projects/PS
Fix Released
Medium
Sergei Glushchenko
5.1
Invalid
Undecided
Unassigned
5.5
Fix Released
Medium
Sergei Glushchenko
5.6
Fix Released
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

Revision history for this message
Valerii Kravchuk (valerii-kravchuk) wrote :

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.

Revision history for this message
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
Revision history for this message
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
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-1423

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.