1

We upgraded our Percona XtraDB servers from version 5.6 to 5.7, and we noticed that the rotation slow query log files created after the initial file are empty. Is this something known in 5.7? How can we resolve this issue?

We also noticed that 5.7 does not have the /etc/mysql/debian.cnf file anymore that used to contain a username and password. Can that have anything to do with this?

Below is an example of these rotational slow query logs on one of our 5.7 servers:

-rw-rw---- 1 mysql mysql  1383157070 Sep 20 16:11 db-erp-1-slow.log
-rw-rw---- 1 mysql mysql           0 Jul 27 06:36 db-erp-1-slow.log-20170728
-rw-rw---- 1 mysql mysql           0 Jul 28 06:30 db-erp-1-slow.log-20170729
-rw-rw---- 1 mysql mysql           0 Jul 29 06:43 db-erp-1-slow.log-20170730
-rw-rw---- 1 mysql mysql           0 Jul 30 06:50 db-erp-1-slow.log-20170731
-rw-rw---- 1 mysql mysql           0 Jul 31 06:43 db-erp-1-slow.log-20170801
-rw-rw---- 1 mysql mysql           0 Aug  1 06:37 db-erp-1-slow.log-20170802
-rw-rw---- 1 mysql mysql           0 Aug  2 06:48 db-erp-1-slow.log-20170803
-rw-rw---- 1 mysql mysql           0 Aug  3 06:42 db-erp-1-slow.log-20170804
-rw-rw---- 1 mysql mysql           0 Aug  4 06:43 db-erp-1-slow.log-20170805

So after the initial log file, db-erp-1-slow.log, the following log files are empty.

3
  • Re slowlog: Are you saying that the 5.6 slowlog was thrown away?
    – Rick James
    Oct 28, 2017 at 14:33
  • It creates new log files daily, but these new files are empty. Only the initial file has slow query logged. Oct 30, 2017 at 3:23
  • How does September come before July?
    – Rick James
    Oct 30, 2017 at 14:41

1 Answer 1

1

Do you restart mysql daily? That could explain the new logs.

Check these VARIABLES:

log_output = FILE   -- or TABLE,FILE
slow_query_log = ON
slow_query_log_file = /...   -- some valid path, including filename
long_query_time = 1   -- or some small value

Perhaps the general log hit a limit, thereby triggering an internal call to FLUSH LOGS, which rotated all logs?

3
  • The system variables are not the issue. These are configured just fine. And no, we do not restart MySQL daily. This is in production, and the query log file has a capacity limit, and hence creates rotating logs when one gets full. I have added a sample of the rotational slow query logs that we get in the original question. Oct 30, 2017 at 13:34
  • @TheGeorgia - until Aug 4 you had the general log turned on? At least some of the time? Maybe there is/was a mysqldump running at 6am? And you turned off the general log? See my added paragraph.
    – Rick James
    Oct 30, 2017 at 14:24
  • When a limit is reached, and MySQL flushed the slow log automatically, the newly generated log(s) should continue to contain new slow queries. But this has not been the case. Oct 30, 2017 at 14:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.