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

MariaDB fails to start up after starting from restore backup with --no-lock

    XMLWordPrintable

Details

    Description

      MariaDB fails to start up after being restores from a restored backup. The backup was created with --no-lock. The log message shows:

      025-03-06  9:28:08 0 [Note] Starting MariaDB 10.11.10-MariaDB-ubu2404-log source revision 3d0fb150289716ca75cd64d62823cf715ee47646 server_uid Cs8IuvdZUiIrxpx4CqyakxxkfYE= as process 2225845
      2025-03-06  9:28:08 0 [Note] InnoDB: Compressed tables use zlib 1.3
      2025-03-06  9:28:08 0 [Note] InnoDB: Using transactional memory
      2025-03-06  9:28:08 0 [Note] InnoDB: Number of transaction pools: 1
      2025-03-06  9:28:08 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
      2025-03-06  9:28:08 0 [Note] InnoDB: Using liburing
      2025-03-06  9:28:08 0 [Note] InnoDB: Initializing buffer pool, total size = 2.292GiB, chunk size = 36.672MiB
      2025-03-06  9:28:08 0 [Note] InnoDB: Completed initialization of buffer pool
      2025-03-06  9:28:08 0 [Note] InnoDB: Buffered log writes (block size=4096 bytes)
      2025-03-06  9:28:09 0 [Note] InnoDB: End of log at LSN=1818695770073
      2025-03-06  9:28:09 0 [Note] InnoDB: Transaction 1315600348 was in the XA prepared state.
      2025-03-06  9:28:09 0 [Note] InnoDB: 1 transaction(s) which must be rolled back or cleaned up in total 0 row operations to undo
      2025-03-06  9:28:09 0 [Note] InnoDB: Trx id counter is 1315600350
      2025-03-06  9:28:09 0 [Note] InnoDB: 128 rollback segments are active.
      2025-03-06  9:28:09 0 [Note] InnoDB: Starting in background the rollback of recovered transactions
      2025-03-06  9:28:09 0 [Note] InnoDB: Setting file './ibtmp1' size to 12.000MiB. Physically writing the file full; Please wait ...
      2025-03-06  9:28:09 0 [Note] InnoDB: File './ibtmp1' size is now 12.000MiB.
      2025-03-06  9:28:09 0 [Note] InnoDB: Rollback of non-prepared transactions completed
      2025-03-06  9:28:09 0 [Note] InnoDB: log sequence number 1818695770073; transaction id 1315600351
      2025-03-06  9:28:09 0 [Note] InnoDB: Loading buffer pool(s) from /data/mysql/current/ib_buffer_pool
      2025-03-06  9:28:09 0 [Note] InnoDB: Buffer pool(s) load completed at 250306  9:28:09
      2025-03-06  9:28:09 0 [Note] Plugin 'FEEDBACK' is disabled.
      250306  9:28:09 server_audit: MariaDB Audit Plugin version 1.4.14 STARTED.
      2025-03-06  9:28:09 0 [Note] mariadbd: Plugin 'METADATA_LOCK_INFO' already installed
      2025-03-06  9:28:09 0 [Warning] 'innodb-log-files-in-group' was removed. It does nothing now and exists only for compatibility with old my.cnf files.
      2025-03-06  9:28:09 0 [Warning] 'innodb-file-format' was removed. It does nothing now and exists only for compatibility with old my.cnf files.
      2025-03-06  9:28:09 0 [Warning] 'innodb-buffer-pool-instances' was removed. It does nothing now and exists only for compatibility with old my.cnf files.
      2025-03-06  9:28:09 0 [Warning] mariadbd: unknown variable 'loose_innodb_adaptive_hash_index_partitions=8'
      2025-03-06  9:28:09 0 [Warning] mariadbd: unknown variable 'loose_super_read_only=0'
      2025-03-06  9:28:09 0 [Note] InnoDB: Starting recovery for XA transactions...
      2025-03-06  9:28:09 0 [Note] InnoDB: Transaction 1315600348 in prepared state after recovery
      2025-03-06  9:28:09 0 [Note] InnoDB: Transaction contains changes to 2 rows
      2025-03-06  9:28:09 0 [Note] InnoDB: 1 transactions in prepared state after recovery
      2025-03-06  9:28:09 0 [Note] Found 1 prepared transaction(s) in InnoDB
      2025-03-06  9:28:09 0 [ERROR] Found 1 prepared transactions! It means that server was not shut down properly last time and critical recovery information (last binlog or tc.log file) was manually deleted after a crash. You have to start server with --tc-heuristic-recover switch to commit or rollback pending transactions.
      2025-03-06  9:28:09 0 [ERROR] Aborting
      250306  9:28:09 server_audit: STOPPED
      

      Without --no-lock I was unabel to reproduce the issue.

      A work-around is to start MariaDB with --tc-heuristic-recover=ROLLBACK, but this is not ideal.

      The issue is similar to MDEV-6660 and it might be the same. But that issue was closed without a comment and no responses after.

      The command I use to create the backup is:

      mariabackup --innobackupex   --no-lock --stream=mbstream --parallel=4 --user=root --port=3306 --host=localhost --socket=/var/run/mysqld/mysqld.sock --password=False  --skip-rocksdb-backup  /tmp | pigz | socat TCP:10......
      

      And to prepare:

       mariabackup --prepare --use-memory=1956M --target-dir=/data/mysql/current"
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              michaeldg Michaël de groot
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

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