I’m always using Percona Xtrabackup (percona-xtrabackup-80-8.0.33-28.1) to backup MySQL 8.0.27.
The backup command was as below:
xtrabackup --user=bakuser --password=‘xxx’ --backup --stream=xbstream --compress --target-dir=/backup/xtrbackup/ > $targetfile;
After that, I copied the backup file (xbstream file) and restored it at target slave machine. Restore command was as below:
xbstream -x -C xtrabackup_backupfiles/<$1
xtrabackup --decompress --parallel=6 --compress-threads=6
find ./xtrabackup_backupfiles/ -name ‘*.qp’ -type f -exec rm -rf {} ;
cd xtrabackup_backupfiles
mkdir -p ‘#innodb_redo’ ‘#innodb_temp’
After I restored successfully, I open the targeted instance, and did some query testing. I got some errors as below:
xxxx I/O related errors.
I checked mysql.log with errors as below:
2024-01-05T02:49:18.009264Z 0 [Warning] [MY-011068] [Server] The syntax ‘log_slave_updates’ is deprecated and will be removed in a future release. Please use log_replica_updates instead.
2024-01-05T02:49:18.009285Z 0 [Warning] [MY-011070] [Server] ‘Disabling symbolic links using --skip-symbolic-links (or equivalent) is the default. Consider not using this option as it’ is deprecated and will be removed in a future release.
2024-01-05T02:49:18.011710Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.27) starting as process 2417780
2024-01-05T02:49:18.036538Z 0 [Warning] [MY-010075] [Server] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 051cdb23-ab75-11ee-be6e-0050569ef18e.
2024-01-05T02:49:18.043796Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2024-01-05T02:49:18.792237Z 1 [ERROR] [MY-011971] [InnoDB] Tablespace ‘innodb_system’ Page [page id: space=0, page number=5] log sequence number 907936556002 is in the future! Current system log sequence number 907864015372.
2024-01-05T02:49:18.792276Z 1 [ERROR] [MY-011972] [InnoDB] Your database may be corrupt or you may have copied the InnoDB tablespace but not the InnoDB log files. Please refer to http://dev.mysql.com/doc/refman/8.0/en/forcing-innodb-recovery.html for information about forcing recovery.
2024-01-05T02:49:18.795447Z 0 [ERROR] [MY-011971] [InnoDB] Tablespace ‘innodb_undo_002’ Page [page id: space=4294967278, page number=130] log sequence number 907938965493 is in the future!Current system log sequence number 907864015372.
2024-01-05T02:49:18.795485Z 0 [ERROR] [MY-011972] [InnoDB] Your database may be corrupt or you may have copied the InnoDB tablespace but not the InnoDB log files. Please refer to http://dev.mysql.com/doc/refman/8.0/en/forcing-innodb-recovery.html for information about forcing recovery.
That’s the second time I faced this error. After that, I used logical backup with mysqldump to setup corrupted slave instances.
I used this backup/restore scripts to manage almost 80 mysql instances. I found if database backup file was more than 50G size, the restore script will be failed with some similar errors.