Bug #98966 mysqlbackup can not use redo log archiving
Submitted: 17 Mar 2020 6:33 Modified: 5 Aug 2020 6:42
Reporter: Jinghua Lin Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Enterprise Backup Severity:S3 (Non-critical)
Version:8.0.19 OS:CentOS (7.5)
Assigned to: CPU Architecture:x86

[17 Mar 2020 6:33] Jinghua Lin
Description:
I want to back up by meb. Though the backup operation is successful, there is a warning.

200316 17:07:53 MAIN WARNING: MySQL query 'DO innodb_redo_log_archive_start('redo_dir','15843496737447792');': 3847, Cannot create redo log archive file '/tmp/redo_arch/15843496737447792/archive.8de91317-5de7-11ea-82af-02000aba3c05.000001.log' (OS errno: 13 - Permission denied)
200316 17:07:53 MAIN    INFO: Failed to start redo log archiving...

I have checked the directory's permission. Everything be right. And I try to activate redo log archiving manually

mysql> DO innodb_redo_log_archive_start('redo_dir','15843496737447792');
ERROR 3844 (HY000): Redo log archive directory '/tmp/redo_arch/15843496737447792' does not exist or is not a directory

But when i use this command "DO innodb_redo_log_archive_start('redo_dir')", it succeed with no error.

So i have a question, if meb should not add the parameter 'subdir'(15843496737447792) or should create the new subdir before starting redo log archiving?

How to repeat:
Setting a value for the innodb_redo_log_archive_dirs system variable:
mysql> set global innodb_redo_log_archive_dirs='redo_dir:/tmp/redo_arch';

create the archive directory:
mkdir /tmp/redo_arch
chown mysql:mysql /tmp/redo_arch
chmod 750 /tmp/redo_arch

use meb to back up:
./mysqlbackup --user=root --password=123456 --socket=/opt/mysql/data/3307/mysqld.sock --backup-dir=/tmp/mount backup

And you can find a warning in the backup result
[5 Aug 2020 6:42] Jinghua Lin
It's not a bug.

The reason why causes a warning is that I use system's root account to execute the backup command. the backup program will create the subdir which belong to root.

So the mysql account has no access to create redo log archive file

we should use mysql's running user to execute the backup command when using redo log archiving.