[MDEV-29109] mariabackup --rsync option broken since 10.3 Created: 2022-07-15  Updated: 2022-11-01  Resolved: 2022-11-01

Status: Closed
Project: MariaDB Server
Component/s: Backup, mariabackup
Affects Version/s: 10.3, 10.4, 10.5, 10.6, 10.7, 10.8
Fix Version/s: 10.3.36, 10.4.26, 10.5.17, 10.6.9, 10.7.5, 10.8.4, 10.9.2, 10.10.0

Type: Bug Priority: Critical
Reporter: Hartmut Holzgraefe Assignee: Julius Goryavsky
Resolution: Fixed Votes: 1
Labels: regression

Issue Links:
Problem/Incident
is caused by MDEV-27524 Incorrect binlogs after Galera SST us... Closed
Relates
relates to MDEV-28758 Mariabackup copies binary logs to bac... Closed

 Description   

When running mariabackup with the --rsync option backups fail starting with MariaDB 10.3 with:

rsync: link_stat "/var/lib/mysql/var/lib/mysql/ib_buffer_pool" failed: No such file or directory (2)

Note how the datadir part in the path is duplicated.

More complete output:

root@ubuntu-focal:~# mariabackup --backup --user=root --rsync
[00] 2022-07-15 13:23:14 Connecting to MySQL server host: localhost, user: root, password: not set, port: not set, socket: /run/mysqld/mysqld.sock
[00] 2022-07-15 13:23:14 Using server version 10.5.16-MariaDB-1:10.5.16+maria~focal-log
mariabackup based on MariaDB server 10.5.16-MariaDB debian-linux-gnu (x86_64)
[...]
[00] 2022-07-15 13:23:15 Starting rsync as: rsync -t . --files-from=/tmp/xtrabackup_rsyncfiles_pass1 /root/xtrabackup_backupfiles/
rsync: link_stat "/var/lib/mysql/var/lib/mysql/ib_buffer_pool" failed: No such file or directory (2)
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1207) [sender=3.1.3]
[00] 2022-07-15 13:23:15 rsync finished successfully.
[00] 2022-07-15 13:23:15 Finished a prep copy of non-InnoDB tables and files
[00] 2022-07-15 13:23:15 Acquiring BACKUP LOCKS...
[00] 2022-07-15 13:23:15 Starting to backup non-InnoDB tables and files
[00] 2022-07-15 13:23:15 Starting rsync as: rsync -t . --files-from=/tmp/xtrabackup_rsyncfiles_pass2 /root/xtrabackup_backupfiles/
rsync: link_stat "/var/lib/mysql/var/lib/mysql/ib_buffer_pool" failed: No such file or directory (2)
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1207) [sender=3.1.3]
[00] 2022-07-15 13:23:15 Error: rsync failed with error code 1
mariabackup: Stopping log copying thread.[00] 2022-07-15 13:23:15 >> log scanned up to (55832)

PS: I also wonder what this option is good for anyway?

The documentation says:

During normal operation, Mariabackup transfers local
non-InnoDB files using a separate call to cp for each file. 
Using this option, you can optimize this process by 
performing this transfer with rsync, instead.

which does not make sense to me as there is nothing for rsync to optimize if the target directory is empty anyways, as is required by mariabackup? So rsync would just fall back to a regular cp?



 Comments   
Comment by Elena Stepanova [ 2022-07-20 ]

The failure appeared in 10.2 after this commit:

commit 17e0f5224c8339ec08707a6ad0397bbf8c19bbd3
Author: Julius Goryavsky
Date:   Tue Feb 22 10:45:06 2022 +0100
 
    MDEV-27524: Incorrect binlogs after Galera SST using rsync and mariabackup

Comment by Hartmut Holzgraefe [ 2022-10-31 ]

Seems to have been fixed meanwhile, can still reproduce it with e.g. 10.5.16, but could not anymore with latest 10.3, 10.5 and 10.10

Comment by Julius Goryavsky [ 2022-11-01 ]

Fixed by MDEV-28758

Generated at Thu Feb 08 10:05:58 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.