Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

[mysql] Slow Query Log disable #965

Open
aaronsegura opened this issue Jun 27, 2014 · 2 comments
Open

[mysql] Slow Query Log disable #965

aaronsegura opened this issue Jun 27, 2014 · 2 comments
Labels

Comments

@aaronsegura
Copy link

Attempting to disable slow query logs does not behave as expected. Added to the environment file a few different ways...

"mysql" : {
"server": {
"slow_query_log" : (0|false|"0"|"false")
"log_slow_queries": (0|false|"0"|"false")
}
}

Chef will run and update the /etc/mysql/my.cnf file, but not in any way that actually disables mysql slow query logging. You also need to restart mysql to make it see the changes. The [reload] during the chef-client run is not enough.

I found the rpc-support cookbook has this already in it @ replication_fix.rb:

node.override["mysql"]["server"]["slow_query_log"] = false

...but...

root@577875-controller02:~# mysql -e "show global variables like '%slow%'"
+---------------------+---------------------------------------------+
| Variable_name | Value |
+---------------------+---------------------------------------------+
| log_slow_queries | ON |
| slow_launch_time | 2 |
| slow_query_log | ON |
| slow_query_log_file | /var/lib/mysql/577875-controller02-slow.log |
+---------------------+---------------------------------------------+

(╯° °)╯︵ ┻━┻)

@claco
Copy link
Contributor

claco commented Jun 27, 2014

@ToxicK What ended up in the my.cnf that was templated by chef?

@claco
Copy link
Contributor

claco commented Jun 27, 2014

The short answer is, the upstream mysql cookbook doesn't get it right, even the one we use in master and 4.2.3rc.

https://github.com/opscode-cookbooks/mysql/blob/b5072e6ae3bd81b0f6ebec8749f2c2d781271ed9/templates/default/deprecated/my.cnf.erb#L149

The else block should be slow_query_log = 0 and log_slow_queries is long since deprecated and ignored.

Using a newer mysql cookbook brings its own set of issues, so not sure how this will get tackled at the moment.

@claco claco added the bug label Jun 27, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants