slow_query_log_file has default value if applied in conjunction with max_slowlog_size

Description

I am trying to configure a pxc server with a custom configuration for slow log files, and I need to add the following:

[mysqld]
slow_query_log = ON
slow_query_log_file = /var/lib/mysql/slow
long_query_time = 10
max_slowlog_files = 2
max_slowlog_size = 510000000

so, I created a custom file that will be included in the main configuration and I have shared it when running docker with the following command:

docker run -v $(pwd)/my.cnf.d:/etc/my.cnf.d -e MYSQL_ROOT_PASSWORD=abc --rm -it percona/percona-xtradb-cluster:8.0.36-28.1

when I access container, I see that configuration is not reported correctly inside global vars:

mysql> show global variables like '%slow_query_log_file%'

if I remove max_slowlog_size from custom configuration, Variable_name has the correct value:

This is causing a problem with pmm, since it reads that variable, but it cannot open the file, which is present with the name I specify in configuration:

A similar issue is described here.

Environment

None

AFFECTED CS IDs

CS0048582

Activity

Show:

Oleksandr Kachan August 22, 2024 at 2:38 PM

Hello ,

Some additional info here. According to documentation slow_query_log_file value defaults to <host_name>-slow.log. At the same time hostname inside container is set to container ID.

I see there is slow_query_log_file file set in config passed to docker container but looks like something vent wrong and that config doesn’t take effect. In my case in config I set

and later in mysqlclient I see

So slow_query_log_file variable seem to behave according to documentation in this case.

Oleksandr Kachan August 19, 2024 at 4:11 PM

Ok, look at the following

So that is a docker container ID being added as a prefix to log name.

Oleksandr Kachan August 19, 2024 at 3:59 PM

The issue seem to be more generic. I see the following when reproducing above described steps

Aaditya Dubey August 6, 2024 at 10:27 AM
Edited

Hi

This report is verified as well.

Aaditya Dubey August 6, 2024 at 9:14 AM

Hi

Thank you for the report.
This issue is already being tracked here so as soon as a bug is fixed in PS, this should be fixed by default.

Done

Assignee

Reporter

Needs QA

Time tracking

6h logged

Affects versions

Priority

Created July 12, 2024 at 2:44 PM
Updated January 27, 2025 at 10:41 AM
Resolved October 24, 2024 at 8:05 AM