Xtrabackup 8.0.14 - MySQL 8.0.21 - archive logs dir issue

Hi, another question on xtrabackup.
On the log of the backup i see this error:

Error: failed to fetch query result select innodb_redo_log_archive_start('', '1611929189201'): Label '' not found in server variable 'innodb_redo_log_archive_dirs'
xtrabackup: Redo Log Archiving is not used.

I have setted the innodb_redo_log_archive_dirs:

mysql> show VARIABLES LIKE 'innodb_redo_log_archive_dirs';
+------------------------------+-----------------------------+
| Variable_name                | Value                       |
+------------------------------+-----------------------------+
| innodb_redo_log_archive_dirs | arch1:/var/backup/arch_logs |
+------------------------------+-----------------------------+
1 row in set (0.01 sec)

But xtrabackup try to find it without the alias arch1, how can I tell to xtrabackup to use the alias arch1?

Thanks

2 Likes

Hi @StefanoG .

Xtrabackup will populate the label used in the mentioned query after it confirms it has access to the folder where you store your archive logs. Check a few lines before your error and you will see that xtrabackup reported an error while trying to access /var/backup/arch_logs .

Here is one example:

mysql> SHOW VARIABLES LIKE 'innodb_redo_log_archive_dirs';
+------------------------------+------------------+
| Variable_name                | Value            |
+------------------------------+------------------+
| innodb_redo_log_archive_dirs | label1:/backups1 |
+------------------------------+------------------+
1 row in set (0.00 sec)

Running xtrabackup while it has no access to /backup1 gives me the same error:

xtrabackup: Can't create directory '/backups1' (OS errno 13 - Permission denied)
Error: failed to fetch query result select innodb_redo_log_archive_start('', '1613390070006'): Label '' not found in server variable 'innodb_redo_log_archive_dirs'
xtrabackup: Redo Log Archiving is not used.
1 Like

Hi Marcelo,
sorry for my silence but I came back on this part of the project only in these days.
The user “backup” should do not have problems, because:

The backup user belong at mysql linux group

[backup@dadi backup]$ id backup
uid=1004(backup) gid=989(mysql) groups=989(mysql)

and the group mysql can read the archivelog dir:
[backup@dadi backup]$ ls -l /var/backup/a* total 4 drwxr-x--- 2 backup mysql 4096 Jan 29 11:06 1611914808622

And the dir is set inside mysql

+------------------------------+-----------------------------+
| Variable_name                | Value                       |
+------------------------------+-----------------------------+
| innodb_redo_log_archive_dirs | arch1:/var/backup/arch_logs |
| innodb_redo_log_encrypt      | OFF                         |
+------------------------------+-----------------------------+
2 rows in set (0.01 sec)

mysql> SELECT user();
+------------------+
| user()           |
+------------------+
| backup@localhost |
+------------------+
1 row in set (0.00 sec)

but the xtrabackup command gives these errors:
Error: failed to fetch query result select innodb_redo_log_archive_start('', '1615845663328'): Label '' not found in server variable 'innodb_redo_log_archive_dirs'

Is the label the issue?
If is this the issue how can I give the label to xtrabackup command?

And why in the log i find also this warning:
WARNING: unknown option --innodb-log-arch-dir=/var/backup/arch_logs

Thanks

Stefano Giostra

1 Like

Hi Marcelo, I understand my error,
the parameter --innodb-log-arch-dir=${parent_dir}/arch_logs can be used only whit the prepare step.
Not in the backup step.

Thanks for the support and the patience.
I have a last question.
The prepare step is made when I wish to prepare the backup for a restore.
it is not recommended made it at every scheduled backup, right?

Stefano

1 Like

Hi Stefano,

You are correct, the prepare step will perform a routine similar to InnoDB Crash Recovery. It will apply the data that was generated on redologs while the backup was running. If you don’t intend to use those backups as a base for incremental backups, you can have them prepared and ready to be restored.
Also, as a validation matric, you can prepare the backups to make sure it all works fine and you can restore from those backups.

1 Like