Incorrect definition of table mysql.column_stats: after upgrade from 10.6.5 to 10.8.3 with docker container
After upgrading the mariadb docker-container from 10.6.5 to 10.8.3 I am getting the following errors and the container crashes within a few seconds:
sqb_mariadb | 2022-06-18 13:59:13 4 [ERROR] Incorrect definition of table mysql.column_stats: expected column 'hist_type' at position 9 to have type enum('SINGLE_PREC_HB','DOUBLE_PREC_HB','JSON_HB'), found type enum('SINGLE_PREC_HB','DOUBLE_PREC_HB'). sqb_mariadb | 2022-06-18 13:59:13 4 [ERROR] Incorrect definition of table mysql.column_stats: expected column 'histogram' at position 10 to have type longblob, found type varbinary(255). ... sqb_mariadb | 2022-06-18 13:59:13+00:00 [Note] [Entrypoint]: Backing up complete sqb_mariadb | 2022-06-18 13:59:13+00:00 [Note] [Entrypoint]: Starting mariadb-upgrade sqb_mariadb | Reading datadir from the MariaDB server failed. Got the following error when executing the 'mysql' command line client sqb_mariadb | ERROR 2002 (HY000): Can't connect to server on 'sqb_mariadb' (115) sqb_mariadb | FATAL ERROR: Upgrade failed
The container is started through docker-compose:
version: '3' services: sqb_mariadb: image: mariadb:latest container_name: sqb_mariadb command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW --innodb_read_only_compressed=OFF restart: unless-stopped volumes: - mariadb:/var/lib/mysql environment: - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD} - MYSQL_PASSWORD=${MYSQL_PASSWORD} - MYSQL_DATABASE=sqb_nextcloud - MYSQL_ROOT_USER=root - MYSQL_HOST=sqb_mariadb - MYSQL_USER=sqb_admin - MARIADB_AUTO_UPGRADE=1 - MARIADB_INITDB_SKIP_TZINFO=1
Repairing this like mentioned here: https://github.com/photoprism/photoprism/issues/2382 or here: https://community.home-assistant.io/t/mariadb-errors-after-update/424731/4 doesn't work due to the immediate crashing of the container.
Any hint on how to resolve the issue is appreciated!!!
Setting the version back to 10.6.5 leaves me with another error:
sqb_mariadb | 2022-06-18 14:17:05 0 [ERROR] InnoDB: Unsupported redo log format. The redo log was created with MariaDB 10.8.3. sqb_mariadb | 2022-06-18 14:17:05 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error sqb_mariadb | 2022-06-18 14:17:05 0 [Note] InnoDB: Starting shutdown... sqb_mariadb | 2022-06-18 14:17:06 0 [ERROR] Plugin 'InnoDB' init function returned error. sqb_mariadb | 2022-06-18 14:17:06 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed. sqb_mariadb | 2022-06-18 14:17:06 0 [Note] Plugin 'FEEDBACK' is disabled. sqb_mariadb | 2022-06-18 14:17:06 0 [ERROR] Unknown/unsupported storage engine: InnoDB sqb_mariadb | 2022-06-18 14:17:06 0 [ERROR] Aborting
Answer Answered by Daniel Black in this comment.
MDEV-28866 is for the upgrade issue.
Running the container without MARIADB_AUTO_UPGRADE=1 will still work on 10.8.
Version downgrades aren't supported so the second cannot work.