# xtrabackup blocked in prepare stage

**URL:** <https://forums.percona.com/t/xtrabackup-blocked-in-prepare-stage/5059>\
**Category:** Percona XtraBackup\
**Created:** [August 30, 2016, 1:46am UTC](https://forums.percona.com/t/xtrabackup-blocked-in-prepare-stage/5059 "2016-08-30T01:46:42Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![neonknight](https://avatars.discourse-cdn.com/v4/letter/n/ce73a5/32.png) [@neonknight](https://forums.percona.com/u/neonknight)\
**Post date:** [August 30, 2016, 1:46am UTC](https://forums.percona.com/t/xtrabackup-blocked-in-prepare-stage/5059/1 "2016-08-30T01:46:42Z")

</div>

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:

```auto
InnoDB: Waited for 30530 seconds for 128 pending reads

```

The script looks as follows:

```auto
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.

---

<div class="post-metadata">

**Author:** ![ShahriyarR](https://avatars.discourse-cdn.com/v4/letter/s/87869e/32.png) [@ShahriyarR](https://forums.percona.com/u/ShahriyarR)\
**Post date:** [August 31, 2016, 1:11am UTC](https://forums.percona.com/t/xtrabackup-blocked-in-prepare-stage/5059/2 "2016-08-31T01:11:45Z")

</div>

Hi,  
Could you please try to use updated script?  
I would like to change you commands:

```auto
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.

---

<div class="post-metadata">

**Author:** ![neonknight](https://avatars.discourse-cdn.com/v4/letter/n/ce73a5/32.png) [@neonknight](https://forums.percona.com/u/neonknight)\
**Post date:** [September 2, 2016, 5:12pm UTC](https://forums.percona.com/t/xtrabackup-blocked-in-prepare-stage/5059/3 "2016-09-02T17:12:42Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![ShahriyarR](https://avatars.discourse-cdn.com/v4/letter/s/87869e/32.png) [@ShahriyarR](https://forums.percona.com/u/ShahriyarR)\
**Post date:** [September 6, 2016, 3:34am UTC](https://forums.percona.com/t/xtrabackup-blocked-in-prepare-stage/5059/4 "2016-09-06T03:34:02Z")

</div>

Could you please share full log of prepare process?

---

<div class="post-metadata">

**Author:** ![neonknight](https://avatars.discourse-cdn.com/v4/letter/n/ce73a5/32.png) [@neonknight](https://forums.percona.com/u/neonknight)\
**Post date:** [September 15, 2016, 1:36am UTC](https://forums.percona.com/t/xtrabackup-blocked-in-prepare-stage/5059/5 "2016-09-15T01:36:16Z")

</div>

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.
