Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-33737

The way of ignoring alter-algorithm is inconsistent with other options and with itself

    XMLWordPrintable

Details

    • Bug
    • Status: In Testing (View Workflow)
    • Critical
    • Resolution: Unresolved
    • N/A
    • 11.5
    • Variables
    • None

    Description

      Note: Please do not rebase or force-push, just push a fix on top of the tree as a separate commit!

      The alter_algorithm variable and option has become unused but preserved for backward compatibility.

      When it is set at runtime, a warning is produced and the variable's value remains unchanged:

      bb-11.5-monty f551fa75e13dd57b057117c570f2e2414ec6d500, bb-11.5-MDEV-32188-timestamps c36c32c955d13f19cd36abc5af194f51f5b7edc4

      set alter_algorithm=COPY;
      Warnings:
      Warning	4200	The variable '@@alter_algorithm' is deleted and ignored. It it only exists for compatiblity with old installations
      select @@alter_algorithm;
      @@alter_algorithm
      DEFAULT
      

      However, if it is set upon startup, no warning is produced, and the value is actually set (even though ignored upon ALTER execution anyway):

      # restart: --alter-algorithm=COPY
      select @@alter_algorithm;
      @@alter_algorithm
      COPY
      

      Even though we don't expect many users to have it in cnf file, there is no reason for such inconsistency. Besides, it is potentially dangerous, as it gives a user no hint that the option in the config no longer works.

      In previous releases we already had other options which were made redundant but preserved for compatibility, but they work differently, see for example innodb-log-files-in-group.
      If it's used on startup, it does produce a warning:

      2024-03-20 16:17:31 0 [Warning] 'innodb-log-files-in-group' was removed. It does nothing now and exists only for compatibility with old my.cnf files.
      

      and if it's used at runtime, it returns an error

      MariaDB [test]> select @@innodb_log_files_in_group;
      ERROR 1193 (HY000): Unknown system variable 'innodb_log_files_in_group'
      

      So, the mechanism already exists and I think it would be sufficient to do the same for alter_algorithm. However, if there is a strong reason to make it produce a warning instead of an error at runtime, let it be so, but

      1) produce a warning upon startup too, as it's the most important thing for an unused variable;
      2) fix typos in the warning text

      It it only exists for compatiblity with old installations

      (remove extra "it" and correct "compatibility").

      All above together in an MTR test:

      --source include/have_innodb.inc
       
      query_vertical select * from information_schema.system_variables where variable_name = 'ALTER_ALGORITHM';
      set alter_algorithm=COPY;
      select @@alter_algorithm;
       
      --let $restart_parameters= --alter-algorithm=COPY
       
      --source include/restart_mysqld.inc
      select @@alter_algorithm;
      

      Attachments

        Issue Links

          Activity

            People

              monty Michael Widenius
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.