xtrabackup blocked in prepare stage

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:

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.

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.

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?

Could you please share full log of prepare process?

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.