Search code examples
mysqlmariadbhaproxygalera

Session Variables different to global Variables in MariaDB


I'm running a Galera Cluster with a HAProxy-LB in front. However my users reporting that the session variable wait_timeout is set to 60.

I checked that with SHOW SESSION VARIABLES LIKE "%wait_timeout%" and for me the result is wait_timeout 610.

In my /etc/mysql/my.cnf (on every cluster node) the value "28800" is set (as default) I can confirm that this is used by running: SHOW GLOBAL VARIABLES LIKE "%wait_timeout%" as the result is wait_timeout 28800

Any ideas why this does not apply to new sessions? The HAProxy is afaik just a stupid forwarder on port 3306..

Edit: Updated all the packages on all cluster nodes. Still the same issue. I even tried to check it with the mysql socket connection for root and the new session spawns with a wait_timeout value of 60. New session for user root


Solution

  • I found the issue. In a different configuration (some admin had made a separate config for "fine tuning" under /etc/mysql/conf.d/finetuning.cnf) was a variable named interactive_timeout which was set to 60. It seems that this one set the session variable of wait_timeout to 60 instead of using the wait_timeout (28800) from the global variables. Commenting out the interactive_timeout solved the problem for me.