[MDEV-18438] mbstream Recreates xtrabackup_info On Same Directory as Backup File Created: 2019-01-31  Updated: 2020-08-25  Resolved: 2019-09-23

Status: Closed
Project: MariaDB Server
Component/s: Backup
Affects Version/s: 10.2.21
Fix Version/s: 10.2.28

Type: Bug Priority: Major
Reporter: Jervin R Assignee: Vladislav Lesin
Resolution: Fixed Votes: 2
Labels: None
Environment:

CentOS 7.x



 Description   

Backup is created with the command below:

mariabackup --host=localhost  --password=*******  --user=percona  --no-timestamp --backup --incremental-basedir=/var/bkp/stor/incr/2019_01_31-19_07_34/2019_01_31-20_02_53 --stream=xbstream --parallel=4 --extra-lsndir=/var/bkp/stor/incr/2019_01_31-19_07_34/2019_01_31-20_36_56 --binlog-info=on --target-dir /var/bkp/stor/incr/2019_01_31-19_07_34/2019_01_31-20_36_56

It creates this file:

[root@ip-10-1-2-91 ~]# ls -alh /var/bkp/stor/incr/2019_01_31-19_07_34/2019_01_31-20_36_56/backup.xbs
-rw-r--r--. 1 root root 280M Jan 31 20:37 /var/bkp/stor/incr/2019_01_31-19_07_34/2019_01_31-20_36_56/backup.xbs
[root@ip-10-1-2-91 ~]# file /var/bkp/stor/incr/2019_01_31-19_07_34/2019_01_31-20_36_56/backup.xbs
/var/bkp/stor/incr/2019_01_31-19_07_34/2019_01_31-20_36_56/backup.xbs: data
[root@ip-10-1-2-91 ~]#

While trying to extract the data to another folder, it works the first time but not on the second because it also extracted a copy of xtrabackup_info on the same folder where the xbs file is.

[root@ip-10-1-2-91 2019_01_31-20_36_56]# pwd
/var/bkp/work/2019_01_31-20_36_56
[root@ip-10-1-2-91 2019_01_31-20_36_56]# cat /var/bkp/stor/incr/2019_01_31-19_07_34/2019_01_31-20_36_56/backup.xbs | mbstream -x -C .
[root@ip-10-1-2-91 2019_01_31-20_36_56]# rm -rf *
[root@ip-10-1-2-91 2019_01_31-20_36_56]# cat /var/bkp/stor/incr/2019_01_31-19_07_34/2019_01_31-20_36_56/backup.xbs | mbstream -x -C .
mbstream: Can't create/write to file '/var/bkp/stor/incr/2019_01_31-19_07_34/2019_01_31-20_36_56//xtrabackup_info' (Errcode: 17 "File exists")
mbstream: failed to create file.
[root@ip-10-1-2-91 2019_01_31-20_36_56]#

This is minor since we can just make sure to remove that file, but the purpose of -C is to not write anything on any other folder except the one specified.



 Comments   
Comment by Bharathkumar [ 2019-05-03 ]

Facing same issue with my backup and restore software, which use mariabackup packaged with 10.3.10-MariaDb.

Comment by Robert Bindar [ 2019-09-23 ]

Fixed for 10.2 in https://github.com/MariaDB/server/commit/c0db3fe6dabd2cb0df9bf532f54f9e8d233fa499
Many thanks for reporting this bug.

Comment by Matej Žerovnik [ 2020-06-11 ]

I'm not sure if I should comment here or open a new bug. But since it's the same bug, it might be OK.

I'm getting the same error with MariaDB 10.3.17 (mariadb-10.3.17-1.module_el8.1.0+257+48736ea6.x86_64) on CentOS 8. Should this be fixed on 10.3?

$ pwd
/var/lib/mysql/mysqldumps/
$ lz4 -d backup.stream.gz | mbstream  -x -C .
mbstream: Can't create directory '/opt/mariabackup/base/2020-06-09_03-00-01//' (Errcode: 2 "No such file or directory")
[00] 2020-06-11 12:40:31 mbstream: failed to create file.

/opt/mariabackup/base/2020-06-09_03-00-01/ is the target backup folder in backup server.

Comment by Robert Bindar [ 2020-06-11 ]

Hi matejzero, thanks for taking the time to report this issue!
I'm not sure it is the same bug, the error message seems a bit different at a first glance. Can you please create a new task and tag me there in a comment so that it gets to my todo list for further investigation?
This particular mdev should be fixed in 10.3

Comment by Matej Žerovnik [ 2020-06-11 ]

It seems like I can't tag you. New issue is opened under https://jira.mariadb.org/browse/MDEV-22872.

Generated at Thu Feb 08 08:44:06 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.