[MDEV-30631] System variables metadata shouldn't show values of INNODB_COMPRESSION_ALGORITHM that can't be set Created: 2023-02-10  Updated: 2023-06-08  Resolved: 2023-04-01

Status: Closed
Project: MariaDB Server
Component/s: None
Affects Version/s: 10.6
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: Daniel Lenski Assignee: Unassigned
Resolution: Incomplete Votes: 0
Labels: None

Issue Links:
PartOf
is part of MDEV-6361 innodb_compression_algorithm configur... Closed

 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.



 Comments   
Comment by Sergei Golubchik [ 2023-02-28 ]

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

Comment by Robin Newhouse [ 2023-06-08 ]

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.

Generated at Thu Feb 08 10:17:43 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.