Not the answer you need?
Register and ask your own question!

xtrabackup blocked in prepare stage

neonknightneonknight EntrantInactive User Role Beginner
Good Day Forum

I run a MariaDB backup job for my InnoDB tables with xtrabackup. The database is fairly simple (no foreign keys, no triggers, but tables are partitioned) and not excessively large (9GB). The actual backup runs fine, but the first prepare run sometimes gets stuck with message:
InnoDB: Waited for 30530 seconds for 128 pending reads

The script looks as follows:
BACKUPDIR=/data/backup/mysql-percona-backup/
EXTRAFILE=/etc/my.cnf.percona
xtrabackup --defaults-file=$EXTRAFILE --backup --no-timestamp --target_dir=$BACKUPDIR
xtrabackup --defaults-file=$EXTRAFILE --prepare --target_dir=$BACKUPDIR
xtrabackup --defaults-file=$EXTRAFILE --prepare --target_dir=$BACKUPDIR

the EXTRAFILE has the following content:
[mysqld]
innodb_log_file_size=5M
socket=/var/lib/mysql/mysql.sock

xtrabackup version: xtrabackup version 2.4.4 based on MySQL server 5.7.13 Linux (x86_64) (revision id: df58cf2)
MariaDB version: mysql Ver 15.1 Distrib 5.5.51-MariaDB, for Linux (x86_64) using readline 5.1
OS: CentOS release 6.8 (Final)

Am I missing something? How can this be prevented? Please let me know if more information is needed.

Comments

  • ShahriyarRShahriyarR Contributor Inactive User Role Beginner
    Hi,
    Could you please try to use updated script?
    I would like to change you commands:
    BACKUPDIR=/data/backup/mysql-percona-backup/
    # comment1 instead of separate config file pass actual MariaDB's my.cnf
    #EXTRAFILE=/etc/my.cnf.percona
    EXTRAFILE=/etc/my.cnf
    # comment1
    xtrabackup --defaults-file=$EXTRAFILE --backup --no-timestamp --target_dir=$BACKUPDIR
    # comment2 You are preparing full backup twice. No need for second run here.
    # Also try to pass "backup-my.cnf" as defaults file at prepare stage
    #xtrabackup --defaults-file=$EXTRAFILE --prepare --target_dir=$BACKUPDIR
    xtrabackup --defaults-file=$BACKUPDIR/backup-my.cnf --prepare --target_dir=$BACKUPDIR
    # comment2
    

    Please give a try.
  • neonknightneonknight Entrant Inactive User Role Beginner
    Thank you for your suggestions. I have applied them, however the backup process is still stuck in prepare stage. Do you have any other suggestion?
  • ShahriyarRShahriyarR Contributor Inactive User Role Beginner
    Could you please share full log of prepare process?
  • neonknightneonknight Entrant Inactive User Role Beginner
    Apologies for the late reply and thank you for your assistance, but I have given up on trying to fix this and simply reinstalled the machine. It is now working as expected. Looks like the box had a hickup somewhere.
Sign In or Register to comment.

MySQL, InnoDB, MariaDB and MongoDB are trademarks of their respective owners.
Copyright ©2005 - 2020 Percona LLC. All rights reserved.