# Xtrabackup: Database page corruption detected at page 135592, retrying

**URL:** <https://forums.percona.com/t/xtrabackup-database-page-corruption-detected-at-page-135592-retrying/35536>\
**Category:** Percona XtraBackup\
**Created:** [December 9, 2024, 3:04am UTC](https://forums.percona.com/t/xtrabackup-database-page-corruption-detected-at-page-135592-retrying/35536 "2024-12-09T03:04:35Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![calvin\_zhang](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/calvin_zhang/32/19308_2.png) [@calvin\_zhang](https://forums.percona.com/u/calvin_zhang)\
**Post date:** [December 9, 2024, 3:04am UTC](https://forums.percona.com/t/xtrabackup-database-page-corruption-detected-at-page-135592-retrying/35536/1 "2024-12-09T03:04:35Z")

</div>

Hi there:

I use xtrabackup to backup mysql database,sometimes I get error as below:  
[01] xtrabackup: Database page corruption detected at page 135592, retrying…  
[01] xtrabackup: Database page corruption detected at page 135592, retrying…  
[01] xtrabackup: Database page corruption detected at page 135592, retrying…  
[01] xtrabackup: Database page corruption detected at page 135592, retrying…  
[01] xtrabackup: Database page corruption detected at page 135592, retrying…  
[01] xtrabackup: Database page corruption detected at page 135592, retrying…  
[01] xtrabackup: Database page corruption detected at page 135592, retrying…  
[01] xtrabackup: Database page corruption detected at page 135592, retrying…  
[01] xtrabackup: Database page corruption detected at page 135592, retrying…  
241209 01:04:51 \>\> log scanned up to (742656176634)  
[01] xtrabackup: Error: failed to read page after 10 retries. File ./unit\_activity\_center/ua\_meeting\_record\_user.ibd seems to be corrupted.  
[01] xtrabackup: Error: xtrabackup\_copy\_datafile() failed.  
[01] xtrabackup: Error: failed to copy datafile.

Sometimes it happens,not everytime,and page number this time is different than next times’,the corrupt table it shows is also diffenrent.  
My xtrabackup version is percona-xtrabackup-24-2.4.29-1.el9.x86\_64  
My mysql database version is 5.7.38  
Would you please help me to check it?  
thanks in advance.

Best Regards  
Calvin

---

<div class="post-metadata">

**Author:** ![lalit.choudhary](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/lalit.choudhary/32/51_2.png) [@lalit.choudhary](https://forums.percona.com/u/lalit.choudhary)\
**Post date:** [December 9, 2024, 6:12am UTC](https://forums.percona.com/t/xtrabackup-database-page-corruption-detected-at-page-135592-retrying/35536/2 "2024-12-09T06:12:13Z")

</div>

Hello @calvin_zhang

> Sometimes it happens,not everytime,and page number this time is different than next times’,the corrupt table it shows is also diffenrent.  
> My xtrabackup version is percona-xtrabackup-24-2.4.29-1.el9.x86\_64  
> My mysql database version is 5.7.38  
> Would you please help me to check it?  
> thanks in advance.

1st you should check MySQL error log to see if corruption is in the source, try to perform select on the problematic table. If all is good, you can share the xtrabackup command for further review.

This could be a bug as mentioned here:  
[https://perconadev.atlassian.net/browse/PXB-3252](https://perconadev.atlassian.net/browse/PXB-3252)

The issue was in the bug report is “with encryption enabled, database corruption is detected while taking incremental backup. This happens when encryption is enabled|disabled for tablespaces while backup is been taken.”

Are you using encryption?

---

<div class="post-metadata">

**Author:** ![calvin\_zhang](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/calvin_zhang/32/19308_2.png) [@calvin\_zhang](https://forums.percona.com/u/calvin_zhang)\
**Post date:** [December 9, 2024, 7:40am UTC](https://forums.percona.com/t/xtrabackup-database-page-corruption-detected-at-page-135592-retrying/35536/3 "2024-12-09T07:40:49Z")

</div>

Thanks for your reply,I checked MySQL error log as below,there is no error in this log

 ![image](https://us1.discourse-cdn.com/flex019/uploads/percona1/original/3X/f/d/fd5dac9b62a16982d41f6c6a3bd32a3799dc6e6f.png)

My xtrbackup command is as below  
xtrabackup --defaults-file=/etc/my.cnf --backup --no-timestamp --throttle=9 --user=$user\_name --password=$password --socket=$socket --safe-slave-backup --incremental-basedir=$backdir/incr3 --target-dir=$backdir/incr4

I don’t use encryption for tablespaces

---

<div class="post-metadata">

**Author:** ![calvin\_zhang](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/calvin_zhang/32/19308_2.png) [@calvin\_zhang](https://forums.percona.com/u/calvin_zhang)\
**Post date:** [December 9, 2024, 7:56am UTC](https://forums.percona.com/t/xtrabackup-database-page-corruption-detected-at-page-135592-retrying/35536/4 "2024-12-09T07:56:14Z")

</div>

I perform a select query on the problematic table,it’s normal

 ![image](https://us1.discourse-cdn.com/flex019/uploads/percona1/original/3X/c/a/ca0267511b6c4db18c8dc115c25220da714eeff7.png)

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [December 9, 2024, 1:09pm UTC](https://forums.percona.com/t/xtrabackup-database-page-corruption-detected-at-page-135592-retrying/35536/5 "2024-12-09T13:09:33Z")

</div>

Hello @calvin_zhang,  
I would perform a slow shutdown, `SET GLOBAL innodb_fast_shutdown=0`, then stop MySQL. Once stopped, erase the redo logs on disk (rm ib\_logfile0 ib\_logfile1). Start MySQL. This will force InnoDB to create brand new logs. Try a backup and see if it continues to error.

---

<div class="post-metadata">

**Author:** ![calvin\_zhang](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/calvin_zhang/32/19308_2.png) [@calvin\_zhang](https://forums.percona.com/u/calvin_zhang)\
**Post date:** [December 17, 2024, 1:45am UTC](https://forums.percona.com/t/xtrabackup-database-page-corruption-detected-at-page-135592-retrying/35536/6 "2024-12-17T01:45:54Z")

</div>

Hi @matthewb,  
Thanks for your advice,I tried as you told,yesterday’s backup is OK,I’ll continue to pay close attention to my backup,apprectiate to help me if have issue again!

---

<div class="post-metadata">

**Author:** ![calvin\_zhang](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/calvin_zhang/32/19308_2.png) [@calvin\_zhang](https://forums.percona.com/u/calvin_zhang)\
**Post date:** [December 18, 2024, 1:20am UTC](https://forums.percona.com/t/xtrabackup-database-page-corruption-detected-at-page-135592-retrying/35536/7 "2024-12-18T01:20:41Z")

</div>

Hi @matthewb ：  
Yesterday’s backup failed ,can you help me to check again? thanks!

 ![image](https://us1.discourse-cdn.com/flex019/uploads/percona1/original/3X/6/f/6ff46e5216fc2536b65a9e456f4dd23f7900fc38.png)

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [December 18, 2024, 4:06pm UTC](https://forums.percona.com/t/xtrabackup-database-page-corruption-detected-at-page-135592-retrying/35536/8 "2024-12-18T16:06:46Z")

</div>

Hey @calvin_zhang,  
Since the issue came back after creating brand new redo logs, I would go through each table and run `ALTER TABLE foo ENGINE=InnoDB` This will force InnoDB to create a brand new tablespace file on disk and copy the contents. Any page faults should be fixed automatically, or the system will crash with an error on reading one of the bad pages. I suggest you take a full logical backup (mysqldump or mydumper) beforehand.

---

<div class="post-metadata">

**Author:** ![calvin\_zhang](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/calvin_zhang/32/19308_2.png) [@calvin\_zhang](https://forums.percona.com/u/calvin_zhang)\
**Post date:** [December 27, 2024, 1:54am UTC](https://forums.percona.com/t/xtrabackup-database-page-corruption-detected-at-page-135592-retrying/35536/9 "2024-12-27T01:54:05Z")

</div>

Hi @matthewb ：  
Sorry for replying you so late,I did nothing but it worked well recently,I have no idea why,if the issue comes back,I’ll do as you told above,thanks again!

---

<div class="post-metadata">

**Author:** ![calvin\_zhang](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/calvin_zhang/32/19308_2.png) [@calvin\_zhang](https://forums.percona.com/u/calvin_zhang)\
**Post date:** [January 14, 2025, 2:44am UTC](https://forums.percona.com/t/xtrabackup-database-page-corruption-detected-at-page-135592-retrying/35536/10 "2025-01-14T02:44:43Z")

</div>

Hello @matthewb  
Since I backup on my slave node,if I do as you told,it will affect the replication,should I run `ALTER TABLE foo ENGINE=InnoDB` on master node?look forward to your reply,thanks

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [January 14, 2025, 4:21am UTC](https://forums.percona.com/t/xtrabackup-database-page-corruption-detected-at-page-135592-retrying/35536/11 "2025-01-14T04:21:39Z")

</div>

You can run it on the replica only, if that’s the only place the corruption occurs. I hope you understand that you need to run the ALTER TABLE for each table in every database. This will take time. it will affect replication, but replication will catch back up after each ALTER finishes.

---

<div class="post-metadata">

**Author:** ![calvin\_zhang](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/calvin_zhang/32/19308_2.png) [@calvin\_zhang](https://forums.percona.com/u/calvin_zhang)\
**Post date:** [January 14, 2025, 6:03am UTC](https://forums.percona.com/t/xtrabackup-database-page-corruption-detected-at-page-135592-retrying/35536/12 "2025-01-14T06:03:13Z")

</div>

Hi @matthewb  
Yesterday,I rebuilt master-replica on my replica node where I backup failed ,today’s backup still failed,I think master node also have page corruction,what’s your suggestion,should I run the ALTER TABLE for each table in every database on master node?

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [January 14, 2025, 1:20pm UTC](https://forums.percona.com/t/xtrabackup-database-page-corruption-detected-at-page-135592-retrying/35536/13 "2025-01-14T13:20:34Z")

</div>

How did you rebuild the replica? If you used mysqldump/mydumper, you should not have any page corruption on the replica because every data file would be brand new. If you used PXB to take the backup from source, and copied that to replica for restore, then yes, the source must also have some corruption. In that case, yes, you need to run ALTER TABLE for each on source. Or, take a logical backup with [mydumper](https://github.com/mydumper/mydumper), completely erase source and rebuild source brand new with this backup.

---

<div class="post-metadata">

**Author:** ![calvin\_zhang](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/calvin_zhang/32/19308_2.png) [@calvin\_zhang](https://forums.percona.com/u/calvin_zhang)\
**Post date:** [January 22, 2025, 3:46am UTC](https://forums.percona.com/t/xtrabackup-database-page-corruption-detected-at-page-135592-retrying/35536/14 "2025-01-22T03:46:52Z")

</div>

Hi @matthewb  
If using OS crontab to do PXB bakcup regularly,it will fail with a high possibility,but if I do PXB backup manually,it always succeed,I don’t konw why,because some corruption tables are history tables,there are no data writing to these tables

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [January 22, 2025, 4:25am UTC](https://forums.percona.com/t/xtrabackup-database-page-corruption-detected-at-page-135592-retrying/35536/15 "2025-01-22T04:25:51Z")

</div>

Compare the log output from both executions. Compare line-by-line. Find the differences.

---

<div class="post-metadata">

**Author:** ![calvin\_zhang](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/calvin_zhang/32/19308_2.png) [@calvin\_zhang](https://forums.percona.com/u/calvin_zhang)\
**Post date:** [January 22, 2025, 5:59am UTC](https://forums.percona.com/t/xtrabackup-database-page-corruption-detected-at-page-135592-retrying/35536/16 "2025-01-22T05:59:32Z")

</div>

This one is OS crontab executions log output: [xtrabackup\_log\_2025-01-22\_01\_05\_01.txt](https://forums.percona.com/uploads/short-url/ianNrMAa1Csq869M1kCKyteHk8s.txt) (233.5 KB)  
and this one is the log output I backup manually  
[xtrabackup\_log\_2025-01-22\_11\_27\_52.txt](https://forums.percona.com/uploads/short-url/rKtewuPlHzLwEtZgt32v2SF3u8U.txt) (740.5 KB)  
It seems to be same

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [January 22, 2025, 3:41pm UTC](https://forums.percona.com/t/xtrabackup-database-page-corruption-detected-at-page-135592-retrying/35536/17 "2025-01-22T15:41:33Z")

</div>

Yea, they are pretty much the same up until the error.

These parameters are odd:

```auto
--innodb_log_buffer_size=1G --innodb_log_file_size=100M

```

innodb\_log\_buffer\_size rarely needs to be larger than the default 16M. innodb\_log\_file\_size is your redo log size \* number of redo logs (you have 3). Shut down MySQL. Remove the ib\_logfile0/1/2 and increase innodb\_log\_file\_size to 256M (which should result in a total of 768M of redo log capacity.

Also, add `--parallel=4` to your script to make backups finish faster.

---

<div class="post-metadata">

**Author:** ![calvin\_zhang](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/calvin_zhang/32/19308_2.png) [@calvin\_zhang](https://forums.percona.com/u/calvin_zhang)\
**Post date:** [February 5, 2025, 2:29am UTC](https://forums.percona.com/t/xtrabackup-database-page-corruption-detected-at-page-135592-retrying/35536/18 "2025-02-05T02:29:06Z")

</div>

Hi @matthewb :  
I did as you told above,but it seems no work for my issue,the log output  
[xtrabackup\_log\_2025-02-05\_01\_05\_02.txt](https://forums.percona.com/uploads/short-url/emebs0JCOzQdSAo8KdGi1xkAmwj.txt) (339.0 KB)  
Would you please help me to check it,thanks
