Upgrading MariaDB 10.11 to 11.3

34 Views Asked by At

I run MariaDB 10.11 on different Servers and wanted to upgrade to 11.x for a while but struggle with the upgrade. I stop MariaDB. Uninstall the old version and install for example 11.3. Then i always get [ERROR] InnoDB: The change buffer is corrupted. I can make a dump and import the dump after the upgrade and get all data even with the history (I use System-Versioned Tables). But then my users can login without a password even when in mysql.user there is one. I encrypted the database with

plugin_load_add = file_key_management
loose_file_key_management_filename = /etc/mysql/encryption/keyfile.enc
loose_file_key_management_filekey = FILE:/etc/mysql/encryption/keyfile.key
loose_file_key_management_encryption_algorithm = AES_CTR
innodb_encrypt_tables = ON
innodb_encrypt_temporary_tables = ON
innodb_encrypt_log = ON
innodb_encryption_threads = 4
innodb_encryption_rotate_key_age = 1

Full Log of the error after the upgrade:

Mär 27 09:40:22 ln-VM mariadbd[115137]: 2024-03-27  9:40:22 0 [Note] Starting MariaDB 11.3.2-MariaDB-1:11.3.2+maria~ubu2204 source revision 068a6819eb63bcb01fdfa037c9bf3bf63c33ee42 as process 115>
Mär 27 09:40:22 ln-VM mariadbd[115137]: 2024-03-27  9:40:22 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
Mär 27 09:40:22 ln-VM mariadbd[115137]: 2024-03-27  9:40:22 0 [Note] InnoDB: Number of transaction pools: 1
Mär 27 09:40:22 ln-VM mariadbd[115137]: 2024-03-27  9:40:22 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
Mär 27 09:40:22 ln-VM mariadbd[115137]: 2024-03-27  9:40:22 0 [Note] InnoDB: Using liburing
Mär 27 09:40:22 ln-VM mariadbd[115137]: 2024-03-27  9:40:22 0 [Note] InnoDB: Initializing buffer pool, total size = 128.000MiB, chunk size = 2.000MiB
Mär 27 09:40:22 ln-VM mariadbd[115137]: 2024-03-27  9:40:22 0 [Note] InnoDB: Completed initialization of buffer pool
Mär 27 09:40:22 ln-VM mariadbd[115137]: 2024-03-27  9:40:22 0 [Note] InnoDB: File system buffers for log disabled (block size=4096 bytes)
Mär 27 09:40:22 ln-VM mariadbd[115137]: 2024-03-27  9:40:22 0 [Note] InnoDB: Resetting space id's in the doublewrite buffer
Mär 27 09:40:22 ln-VM mariadbd[115137]: 2024-03-27  9:40:22 0 [Note] InnoDB: End of log at LSN=658042216301
Mär 27 09:40:22 ln-VM mariadbd[115137]: 2024-03-27  9:40:22 0 [ERROR] InnoDB: The change buffer is corrupted
Mär 27 09:40:22 ln-VM mariadbd[115137]: 2024-03-27  9:40:22 0 [ERROR] InnoDB: Plugin initialization aborted with error Data structure corruption
Mär 27 09:40:22 ln-VM mariadbd[115137]: 2024-03-27  9:40:22 0 [Note] InnoDB: Starting shutdown...
Mär 27 09:40:22 ln-VM mariadbd[115137]: 2024-03-27  9:40:22 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
Mär 27 09:40:22 ln-VM mariadbd[115137]: 2024-03-27  9:40:22 0 [Note] Plugin 'FEEDBACK' is disabled.
Mär 27 09:40:22 ln-VM mariadbd[115137]: 2024-03-27  9:40:22 0 [Note] Plugin 'wsrep-provider' is disabled.
Mär 27 09:40:22 ln-VM mariadbd[115137]: 2024-03-27  9:40:22 0 [ERROR] Unknown/unsupported storage engine: InnoDB
Mär 27 09:40:22 ln-VM mariadbd[115137]: 2024-03-27  9:40:22 0 [ERROR] Aborting

I thought I can just install the new version and run mariadb-upgrade and everything just works. If I install 11.3 and import the dump, I can´t run mariadb-upgrade because it says, that it is already upgraded. I tried with different MariaDB versions but that doesn´t seem to make a difference.

1

There are 1 best solutions below

0
danblack On

Sorry your change buffer got corrupted. Fortunately it has now been removed and won't cause further problems once you resolve this.

To gain your users in the SQL migration from your earlier version save them and their grants with:

mariadb-dump --system=users --insert-ignore > /tmp/users.sql

Then import into the upgraded instance. If you use --replace to replace existing users you will need to have a new user that wasn't in the original instance of high privileges in order to import the users:

MariaDB [(none)]> create user import_user@localhost;
Query OK, 0 rows affected (0.001 sec)
MariaDB [(none)]> grant all on *.* to import_user@localhost with grant option;
Query OK, 0 rows affected (0.001 sec)

MariaDB [(none)]> grant proxy ON ''@'%' to import_user@localhost with grant option;
Query OK, 0 rows affected (0.001 sec)

MariaDB [(none)]> ^DBye

Restart client with import_user and import the users like they where previously;

mariadb -u  import_user

MariaDB [(none)]> \. /tmp/users.sql
Query OK, 0 rows affected (0.000 sec)
....

MariaDB [(none)]>  drop user import_user@localhost;
Query OK, 0 rows affected (0.001 sec)