[MDEV-7567] rename slow queries variables Created: 2015-02-09  Updated: 2023-03-21  Resolved: 2022-10-04

Status: Closed
Project: MariaDB Server
Component/s: OTHER
Fix Version/s: 10.11.1

Type: Task Priority: Critical
Reporter: VAROQUI Stephane Assignee: Sergei Golubchik
Resolution: Fixed Votes: 3
Labels: Preview_10.11, beginner-friendly

Issue Links:
Blocks
blocks MDEV-7566 log_queries_not_using_index reduce ve... Open
PartOf
is part of MDEV-29547 prepare 10.11.0 preview releases Closed
Problem/Incident
causes MDEV-29297 remove aliases of system variables Open
causes MDEV-29594 sys_vars tests fail on 32-bit with wr... Closed
causes MDEV-29595 Adjust variable name for slow log fil... Closed
causes MDEV-29598 long_query_time description refers to... Closed
causes MDEV-29625 Some clients/scripts refer to old slo... Closed
causes MDEV-29626 Assertion `self == &Sys_slow_query_lo... Closed
causes MDEV-29689 Incorrect variable log_slow_query_fil... Closed
Relates
relates to MDEV-29629 Session state tracking does not track... Closed

 Description   

This task is a proposal to introduce new variables
log_slow_queries_not_using_indexes: alias of log_queries_not_using_indexes
log_slow_queries_not_using_indexes_filter: filter based on task MDEV-7566
log_slow_query_time: alias of long_query_time
log_slow_throttle_queries_not_using_indexes; alias of log_throttle_queries_not_using_indexes introduced in 5.6
log_slow_min_examined_row_limit: alias of min_examined_row_limit



 Comments   
Comment by Michael Qin (Inactive) [ 2022-05-25 ]

The idea here seems to be to rename all variables relating to the slow query log such that they have the prefix "log_slow".

The following is a list of variables I found to be related to the slow query log. The original variable names are on the left and the new aliases, if any, are on the right.

log_queries_not_using_indexes - log_slow_queries_not_using_indexes
log_slow_admin_statements
log_slow_disabled_statements
log_slow_filter
log_slow_rate_limit
log_slow_verbosity
long_query_time - log_slow_query_time
min_examined_row_limit - log_slow_min_examined_row_limit
slow_query_log - log_slow_query_enable
slow_query_log_file - log_slow_query_name

Comment by Otto Kekäläinen [ 2022-07-19 ]

PR https://github.com/MariaDB/server/pull/2137 that implements this has been open since May 31st, 2022.

Comment by Sergei Golubchik [ 2022-07-29 ]

This is generally a good idea.

I'm a bit worried that we have no approach to dealing with aliases. I mean, new aliases are added, duplicates are left, "we'll solve it later, somehow".

May be, something like

  • when a variable is renamed, an alias with the old name is created
  • aliases are not shown in I_S or on SHOW commands unless --old is used. Direct access via @@var works but produces a "deprecated" warning
  • when the last release where the old name was not an alias reaches EOL, the alias is removed.

How does that sound?

Note, this is not something that should be done in this MDEV, this is just a discussion

Comment by Ian Gilfillan [ 2022-07-29 ]

Sounds good. For the --old suggestion, I presume you mean an --old-mode option?

Comment by Sergei Golubchik [ 2022-07-31 ]

right. a new old-mode value, which I didn't bother to find a name for

Comment by Michael Qin (Inactive) [ 2022-08-09 ]

I agree with the suggested approach for dealing with aliases, and can create a new ticket for it. The current PR for this ticket still needs a review.

Comment by Sergei Golubchik [ 2022-08-11 ]

Why do you want an alias for an alias? --log-queries-not-using-indexes is already an alias for --log-slow-filter=not_using_index. I don't see why you need to create --log-slow-queries-not-using-indexes.

Comment by Michael Qin (Inactive) [ 2022-08-18 ]

The idea for that alias and the new aliases in general is to add the prefix log_slow and eventually deprecate old ones like --log-queries-not-using-indexes

Comment by Sergei Golubchik [ 2022-08-20 ]

I understand that. But *-queries-not-using-indexes is going to be eventually deprecated anyway, with any prefix.
I'd say, there is no need to create a deprecated alias for an already deprecated option.

Comment by Sergei Golubchik [ 2022-09-07 ]

also, log_slow_query_enable would be the first variable using xxx_enable naming pattern. Wouldn't it be more consistent to name it just log_slow_query ?

Comment by Sergei Golubchik [ 2022-09-20 ]

bb-10.11-MDEV-7567

Comment by Elena Stepanova [ 2022-09-21 ]

There was some back-and-forth in this task, so, to summarize, as of bb-10.11-MDEV-7567 3b3ce1fbca here is what is de-facto there:

log_slow_min_examined_row_limit (min_examined_row_limit)
log_slow_query                  (slow_query_log)
log_slow_query_file_name        (slow_query_log_file)
log_slow_query_time             (long_query_time)

It remains unclear what was the role-model for log_slow_query_file_name.
We have a variety of patterns with similar meaning:
general_log_file
relay_log_info_file
wsrep_status_file
pid_file
log_error
log_bin_basename
innodb_buffer_pool_filename

but I couldn't find any %_file_name (maybe somewhere in optional plugins, those I didn't check).

So, maybe it should be just log_slow_query_file, like several existing _file's. Or even just log_slow_file, given the variable list

+---------------------------------+
| log_slow_min_examined_row_limit |
| log_slow_slave_statements       |
| log_slow_query_time             |
| log_slow_verbosity              |
| log_slow_admin_statements       |
| log_slow_disabled_statements    |
| log_slow_query                  |
| log_slow_query_file_name        |
| log_slow_rate_limit             |
| log_slow_filter                 |
+---------------------------------+

Filed as MDEV-29595 so that it's not forgotten, with an additional note for an extra fix in help text.

Comment by Elena Stepanova [ 2022-09-21 ]

There is an ambiguity in MDEV-29297 which, I think, may affect the approach to this task.
If the idea of MDEV-29297 is that eventually the deprecated variables/options will start getting rejected, and server startup will start failing, then I think it would make sense to start deprecating (throwing a warning) about the old names of slow-log-related variables/options already now, not waiting for the total sweep in MDEV-29297. It wouldn't be unusual, we already have some deprecated variables here and there. The reason to rush is that slow-log-related options are old and quite widely used, it will take long time to get rid of them; the longer the period between the warning and startup abort, the more chance that the old configuration files will get amended in time.
If, on the other hand, MDEV-29297 implies that the options will be accepted forever, despite the warnings and their absence in sysvars, then there is no such urgency.

Comment by Elena Stepanova [ 2022-09-25 ]

As of bb-10.11-MDEV-7567 957ac458a:

  • MDEV-29594 (32-bit test failures) – needs to be closed, as it's apparently fixed
  • MDEV-29626 (Assertion failure) – needs to be fixed
  • MDEV-29595, MDEV-29625 (names and uses) – need to be either fixed or demoted or closed as "won't fix"
  • MDEV-29598 (description reference) – optional

Please reassign it back to me when all planned fixes are in and the branch is rebased, I'd like to take a look at the resulting status before it's pushed into main.

Comment by Elena Stepanova [ 2022-09-28 ]

As of 36b42630:

  • the branch cannot be pushed into main as it fails in buildbot with numerous mismatches (result files not updated) and MTR aborts before all tests have been run. It needs to be fixed;
  • comment in MDEV-29625:

    From the list in the description, mariadb-report, mysqldumpslow.sh and mysql_client_test remained unchanged. Is it intentional?

    It doesn't necessarily have to be fixed, but needs to be clarified.

Please reassign it back to me when all planned fixes are in and the branch is rebased.

Comment by Elena Stepanova [ 2022-10-03 ]

In my opinion bb-10.11-MDEV-7567 as of 27b7d5d can be pushed into 10.11 main and released with 10.11.1.

The final change is:

new name old alias
log_slow_min_examined_row_limit min_examined_row_limit
log_slow_query slow_query_log
log_slow_query_file slow_query_log_file
log_slow_query_time long_query_time

The new variables are already documented in the KB, with a minor error to fix MDEV-29689.

Generated at Thu Feb 08 07:20:35 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.