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

System variables metadata shouldn't show values of INNODB_COMPRESSION_ALGORITHM that can't be set

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Incomplete
    • 10.6
    • N/A
    • None
    • None

    Description

      See MDEV-6361 for an earlier, closely-related issue.

      The INFORMATION_SCHEMA.SYSTEM_VARIABLES table contains a misleading ENUM_VALUE_LIST for INNODB_COMPRESSION_ALGORITHM. It lists algorithms that are (in principle) supported by MariaDB but (in reality) not compiled into this build.

      Here is an example on Amazon RDS MariaDB 10.6.11, which is built to support zlib, lzma, and none, but not other compression algorithms:

      System variable metadata says that any of the following values are supported: none,zlib,lz4,lzo,lzma,bzip2,snappy

      Welcome to the MariaDB monitor.  Commands end with ; or \g.
      Your MariaDB connection id is 96
      Server version: 10.6.11-MariaDB-log managed by https://aws.amazon.com/rds/
       
      Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
       
      Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
       
      MariaDB [(none)]> select * from information_schema.system_variables where variable_name='INNODB_COMPRESSION_ALGORITHM'\G
      *************************** 1. row ***************************
              VARIABLE_NAME: INNODB_COMPRESSION_ALGORITHM
              SESSION_VALUE: NULL
               GLOBAL_VALUE: zlib
        GLOBAL_VALUE_ORIGIN: COMPILE-TIME
              DEFAULT_VALUE: zlib
             VARIABLE_SCOPE: GLOBAL
              VARIABLE_TYPE: ENUM
           VARIABLE_COMMENT: Compression algorithm used on page compression. One of: none, zlib, lz4, lzo, lzma, bzip2, or snappy
          NUMERIC_MIN_VALUE: NULL
          NUMERIC_MAX_VALUE: NULL
         NUMERIC_BLOCK_SIZE: NULL
            ENUM_VALUE_LIST: none,zlib,lz4,lzo,lzma,bzip2,snappy
                  READ_ONLY: NO
      COMMAND_LINE_ARGUMENT: OPTIONAL
          GLOBAL_VALUE_PATH: NULL
      1 row in set (0.002 sec)
      

      But trying to set not-compiled-in values causes an error:

      MariaDB [(none)]> set global innodb_compression_algorithm=bzip2;
      ERROR 1231 (42000): Variable 'innodb_compression_algorithm' can't be set to the value of 'bzip2'
      MariaDB [(none)]> set global innodb_compression_algorithm=lzma;
      Query OK, 0 rows affected (0.000 sec)
       
      MariaDB [(none)]> set global innodb_compression_algorithm=zlib;
      Query OK, 0 rows affected (0.000 sec)
       
      MariaDB [(none)]> set global innodb_compression_algorithm=none;
      Query OK, 0 rows affected (0.000 sec)
      

      —

      Problem: The list of "allowed values" are not all allowed. In order to determine the actually allowed values, you have to test them one by one, and see which ones don't error out.

      Solution: The code to populate the information_schema metadata tables/views should be updated to list only the allowed values that can actually be set.

      Attachments

        Issue Links

          Activity

            This is easy to fix, list only complied-in algorithms, but only in 10.6.

            10.7+ have this concept of "compression provider plugins", and InnoDB compiles in support for all compression algorithms, but what you can actually use depends on the loaded provider plugins, and this can change even at runtime.

            There will be no easy way for InnoDB to know what provider plugins are loaded and it'd be even more difficult to modify the set of supported algorithms on the fly.

            Considering that I don't think we should fix it even in 10.6

            serg Sergei Golubchik added a comment - This is easy to fix, list only complied-in algorithms, but only in 10.6. 10.7+ have this concept of "compression provider plugins", and InnoDB compiles in support for all compression algorithms, but what you can actually use depends on the loaded provider plugins, and this can change even at runtime. There will be no easy way for InnoDB to know what provider plugins are loaded and it'd be even more difficult to modify the set of supported algorithms on the fly. Considering that I don't think we should fix it even in 10.6

            I am able to show which compression algorithms are complied in the binary with:

            MariaDB [(none)]> SHOW GLOBAL STATUS WHERE Variable_name IN (
                ->    'Innodb_have_zlib',
                ->    'Innodb_have_lz4',
                ->    'Innodb_have_lzo',
                ->    'Innodb_have_lzma',
                ->    'Innodb_have_bzip2',
                ->    'Innodb_have_snappy'
                -> );
            +--------------------+-------+
            | Variable_name      | Value |
            +--------------------+-------+
            | Innodb_have_lz4    | ON    |
            | Innodb_have_lzo    | OFF   |
            | Innodb_have_lzma   | ON    |
            | Innodb_have_bzip2  | OFF   |
            | Innodb_have_snappy | OFF   |
            +--------------------+-------+
            5 rows in set (0.001 sec)
            

            Note: zlib does not show up.

            robinnew Robin Newhouse added a comment - I am able to show which compression algorithms are complied in the binary with: MariaDB [(none)]> SHOW GLOBAL STATUS WHERE Variable_name IN ( -> 'Innodb_have_zlib' , -> 'Innodb_have_lz4' , -> 'Innodb_have_lzo' , -> 'Innodb_have_lzma' , -> 'Innodb_have_bzip2' , -> 'Innodb_have_snappy' -> ); +--------------------+-------+ | Variable_name | Value | +--------------------+-------+ | Innodb_have_lz4 | ON | | Innodb_have_lzo | OFF | | Innodb_have_lzma | ON | | Innodb_have_bzip2 | OFF | | Innodb_have_snappy | OFF | +--------------------+-------+ 5 rows in set ( 0.001 sec) Note: zlib does not show up.

            People

              Unassigned Unassigned
              dlenski Daniel Lenski (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

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