[MDEV-9575] Slow logs empty until long_querys set to 0 Created: 2016-02-17 Updated: 2016-03-21 Resolved: 2016-03-21 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | OTHER |
| Affects Version/s: | 10.0.21-galera |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | darmagan | Assignee: | Unassigned |
| Resolution: | Incomplete | Votes: | 0 |
| Labels: | need_feedback | ||
| Environment: |
Distributor ID: Debian |
||
| Attachments: |
|
| Description |
|
I have a multiple instance mariadb setup and the slow logs on all are not logging. And I know that there are queries longer than 2 seconds(long_query_time).
this two variables I have set manually, without restarting the db.
If I flush the logs on the instance and do a select sleep(3) the query is being logged:
But just that query is being logged. Now if I set the long_query_time to 0 sec, all queries are being logged. I see the ones that take longer than the 2 sec, in the logs, too. Now I set the long_query_time back to 2 sec again. Now the long queries are being logged normally, as they should:
|
| Comments |
| Comment by Elena Stepanova [ 2016-02-17 ] |
|
da, How exactly do you set long_query_time manually? Please paste the command. Also, please note that the attached cnf file does not correspond the ls output that you pasted in the description, apparently they are from different instances. |
| Comment by darmagan [ 2016-02-18 ] |
|
I have attached the my.cnf of all servers. The ls output of all servers look like that(slow_logs empty). I set the long_query_time with: In the separated conf file I have added the changes, too. It looks like this: I have included the conf with !includedir for all my.cnf files: I have set them manually, because I dont want to restart the servers. (I have not restarted them since the changes). Also, I have set the following vars manually: With show variables, I see the vars are set to the right values. |
| Comment by Elena Stepanova [ 2016-02-22 ] |
|
da, As you know, long_query_time and slow_query_log are both global and session variables. Importantly, it means that when you change the global value, this change does not affect already existing connections – only new ones will pick up the value. flush logs does not help here. So, if your workflow is such that the connections running long queries are fairly persistent, it could be that you set the values, but they are not picked up for some time. You ran your test sleep query in the same connection where you set both session and global values (or in a newer one, which picked up the new global value), so naturally it was logged. While you were experimenting with zero value, a new connection was established and started running slow queries, so you got them in the log. Now, I don't have enough data to check if it's really your case or not. You can get a good enough idea if it's so by comparing connection IDs in the slow log – only connections newer than the one you changed the values in would appear in the log. Please let us know what you find out. |
| Comment by Elena Stepanova [ 2016-03-21 ] |
|
Please comment to re-open if you have further information on the issue. |