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

system-wide max transaction id corrupted (from MySQL-5.7 upgrade)

    XMLWordPrintable

Details

    Description

      $ docker run -v  m57:/var/lib/mysql:Z -e MYSQL_INITDB_SKIP_TZINFO=1 -e MYSQL_ROOT_PASSWORD=bob --rm  docker.io/library/mysql:5.7
      2022-12-28 00:12:20+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.40-1.el7 started.
      ...
      $ podman exec jovial_hertz mysql -u root -pbob -e "set global innodb_fast_shutdown=0;SHUTDOWN"
      

      Use same volume in MariaDB:

      11.0.0+1cb0835be98985f20cccd1724ac78de3649eb2e6

      $ podman run --env   MARIADB_AUTO_UPGRADE=1 -v m57:/var/lib/mysql:Z --user mysql mariadb-31171 bash -x -v docker-entrypoint.sh mariadbd
      #!/bin/bash
      set -eo pipefail
      ....
      + mariadbd --skip-grant-tables --loose-innodb_buffer_pool_dump_at_shutdown=0 --skip-slave-start --skip-networking --default-time-zone=SYSTEM --socket=/run/mysqld/mysqld.sock --wsrep_on=OFF --expire-logs-days=0 --loose-innodb_buffer_pool_load_at_startup=0
      ++ date --rfc-3339=seconds
      + printf '%s [%s] [Entrypoint]: %s\n' '2022-12-28 00:23:36+00:00' Note 'Waiting for server startup'
      2022-12-28 00:23:36+00:00 [Note] [Entrypoint]: Waiting for server startup
      + extraArgs=()
      + '[' -z true ']'
      + local i
      + for i in {30..0}
      + docker_process_sql --database=mysql
      + sleep 1
      2022-12-28  0:23:36 0 [Note] mariadbd (server 11.0.0-MariaDB-1:11.0.0+maria~ubu2204) starting as process 106 ...
      2022-12-28  0:23:36 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
      2022-12-28  0:23:36 0 [Note] InnoDB: Number of transaction pools: 1
      2022-12-28  0:23:36 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
      2022-12-28  0:23:36 0 [Note] mariadbd: O_TMPFILE is not supported on /tmp (disabling future attempts)
      2022-12-28  0:23:36 0 [Warning] mariadbd: io_uring_queue_init() failed with ENOSYS: check seccomp filters, and the kernel version (newer than 5.1 required)
      2022-12-28  0:23:36 0 [Warning] InnoDB: liburing disabled: falling back to innodb_use_native_aio=OFF
      2022-12-28  0:23:36 0 [Note] InnoDB: Initializing buffer pool, total size = 128.000MiB, chunk size = 2.000MiB
      2022-12-28  0:23:36 0 [Note] InnoDB: Completed initialization of buffer pool
      2022-12-28  0:23:36 0 [Note] InnoDB: Resetting space id's in the doublewrite buffer
      2022-12-28  0:23:36 0 [Note] InnoDB: Buffered log writes (block size=512 bytes)
      2022-12-28  0:23:36 0 [Note] InnoDB: Opened 3 undo tablespaces
      2022-12-28  0:23:36 0 [Note] InnoDB: 128 rollback segments in 3 undo tablespaces are active.
      2022-12-28  0:23:36 0 [Note] InnoDB: Setting file './ibtmp1' size to 12.000MiB. Physically writing the file full; Please wait ...
      2022-12-28  0:23:36 0 [Note] InnoDB: File './ibtmp1' size is now 12.000MiB.
      2022-12-28  0:23:36 0 [Note] InnoDB: log sequence number 2774559; transaction id 770
      2022-12-28  0:23:36 0 [Note] Plugin 'FEEDBACK' is disabled.
      2022-12-28  0:23:36 0 [ERROR] WSREP: plugin-wsrep-provider can't be enabled if wsrep_on==OFF or wsrep_provider is unset or set to 'none'
      2022-12-28  0:23:36 0 [ERROR] mariadbd: plugin-wsrep-provider can't be enabled if wsrep_on==OFF or wsrep_provider is unset or set to 'none'
      2022-12-28  0:23:36 0 [ERROR] Plugin 'wsrep_provider' init function returned error.
      2022-12-28  0:23:36 1 [Warning] Failed to load slave replication state from table mysql.gtid_slave_pos: 1146: Table 'mysql.gtid_slave_pos' doesn't exist
      2022-12-28  0:23:36 0 [Note] mariadbd: ready for connections.
      Version: '11.0.0-MariaDB-1:11.0.0+maria~ubu2204'  socket: '/run/mysqld/mysqld.sock'  port: 0  mariadb.org binary distribution
      + for i in {30..0}
      + docker_process_sql --database=mysql
      + break
      + '[' 29 = 0 ']'
      + mysql_note 'Temporary server started.'
      + mysql_log Note 'Temporary server started.'
      + local type=Note
      + shift
      ++ date --rfc-3339=seconds
      2022-12-28 00:23:37+00:00 [Note] [Entrypoint]: Temporary server started.
      + printf '%s [%s] [Entrypoint]: %s\n' '2022-12-28 00:23:37+00:00' Note 'Temporary server started.'
      + docker_mariadb_backup_system
      + '[' -n '' ']'
      + local backup_db=system_mysql_backup_unknown_version.sql.zst
      + local oldfullversion=unknown_version
      + '[' -r /var/lib/mysql//mysql_upgrade_info ']'
      + mysql_note 'Backing up system database to system_mysql_backup_unknown_version.sql.zst'
      + mysql_log Note 'Backing up system database to system_mysql_backup_unknown_version.sql.zst'
      + local type=Note
      + shift
      ++ date --rfc-3339=seconds
      2022-12-28 00:23:37+00:00 [Note] [Entrypoint]: Backing up system database to system_mysql_backup_unknown_version.sql.zst
      + printf '%s [%s] [Entrypoint]: %s\n' '2022-12-28 00:23:37+00:00' Note 'Backing up system database to system_mysql_backup_unknown_version.sql.zst'
      + zstd
      + mariadb-dump --skip-lock-tables --replace --databases mysql --socket=/run/mysqld/mysqld.sock
      2022-12-28  0:23:37 4 [Warning] InnoDB: A transaction id in a record of table `mysql`.`engine_cost` is newer than the system-wide maximum.
      2022-12-28  0:23:37 4 [ERROR] InnoDB: We detected index corruption in an InnoDB type table. You have to dump + drop + reimport the table or, in a case of widespread corruption, dump all InnoDB tables and recreate the whole tablespace. If the mariadbd server crashes after the startup or when you dump the tables. Please refer to https://mariadb.com/kb/en/library/innodb-recovery-modes/ for information about forcing recovery.
      2022-12-28  0:23:37 4 [ERROR] mariadbd: Index for table 'engine_cost' is corrupt; try to repair it
      mariadb-dump: Error 1034: Index for table 'engine_cost' is corrupt; try to repair it when dumping table `engine_cost` at row: 0
      + mysql_error 'Unable backup system database for upgrade from unknown_version.'
      + mysql_log ERROR 'Unable backup system database for upgrade from unknown_version.'
      + local type=ERROR
      + shift
      ++ date --rfc-3339=seconds
      + printf '%s [%s] [Entrypoint]: %s\n' '2022-12-28 00:23:37+00:00' ERROR 'Unable backup system database for upgrade from unknown_version.'
      2022-12-28 00:23:37+00:00 [ERROR] [Entrypoint]: Unable backup system database for upgrade from unknown_version.
      + exit 1
      

      "unknown version" is expected as mysql doesn't generate an automatic mysql_upgrade file.

      From amd64-rhel8-dockerlibrary in bb.

      Attachments

        1. 0001-WIP-test-case.patch
          25 kB
          Marko Mäkelä
        2. ibdata1.gz
          32 kB
          Marko Mäkelä
        3. m57.tar.bz2
          956 kB
          Daniel Black

        Issue Links

          Activity

            People

              marko Marko Mäkelä
              danblack Daniel Black
              Votes:
              0 Vote for this issue
              Watchers:
              5 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.