restore failed when set innode_undo_tablespaces
Description
Environment
Attachments
Smart Checklist
Activity

Lalit Choudhary May 12, 2021 at 12:35 PMEdited
Hi
Thank you for the details. The verified issue as described.
Issue: For PXC Operator When using 5.7 version with innodb_undo_tablespaces option backup restore will fail.
About innodb_undo_tablespaces:
Undo logs are stored in the system tablespace by default but can be stored in one or more undo tablespaces instead. The number of undo tablespaces used by InnoDB
is controlled by the innodb_undo_tablespaces
option. This option can only be configured when initializing the MySQL instance. It cannot be changed afterward.
Reproducible steps:
Make sure you add following mysql setting in cr.yaml before starting the cluster 1st time, otherwise MySQL will not allow adding this option once it's already started/initialize.
cr.yaml (MySQL undo tablespace setting)
Taking backup:
As we can see undo tablespace showing in the backup.
But after restore pxc failed to start due to a missing undo file.
[ERROR] InnoDB: Unable to open undo tablespace './/undo001'.
Logs:
Restore pod datadir:
xtrabackup command: I think the problem here is backup not using MySQL configuration in cr.yaml while restore/prepare stage

朱礼程 May 11, 2021 at 6:35 AM
Yes, I add this setting to the configuration before initializing pxc cluster. The problem occurs in restore.
Step:
initialize the pxc cluster with
innodb_undo_tablespaces
setcreate the pxc-backup cr to backup the cluster
cretate the pxc-restore cr to restore the current cluster, the it will fail

Lalit Choudhary May 6, 2021 at 11:38 AM
Hi
Thank you for the report.
As I can see from log you are using 5.7 version. for this version,
The number of undo tablespaces used by
InnoDB
is controlled by theinnodb_undo_tablespaces
option. This option can only be configured when initializing the MySQL instance. It cannot be changed afterward.
Did you add this setting to the configuration before initializing pxc cluster? Adding innodb_undo_tablespaces
option after starting PXC cluster will not work, because Undo logs are stored in the system tablespace by default already which can not be changed later.
Let us know the exact steps. mysql configuration details.
I set innode_undo_tablespaces on my pxc cluster, and then create a pxc-backup and the create a pxc-restore, the restore while failed because the args doesn't set on xtrabackup when restore.