Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-18438

mbstream Recreates xtrabackup_info On Same Directory as Backup File

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 10.2.21
    • 10.2.28
    • Backup
    • None
    • 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.

      Attachments

        Activity

          hkbharath Bharathkumar added a comment - - edited

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

          hkbharath Bharathkumar added a comment - - edited Facing same issue with my backup and restore software, which use mariabackup packaged with 10.3.10-MariaDb.
          robertbindar Robert Bindar added a comment -

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

          robertbindar Robert Bindar added a comment - Fixed for 10.2 in https://github.com/MariaDB/server/commit/c0db3fe6dabd2cb0df9bf532f54f9e8d233fa499 Many thanks for reporting this bug.

          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.

          matejzero Matej Žerovnik added a comment - 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.
          robertbindar Robert Bindar added a comment -

          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

          robertbindar Robert Bindar added a comment - 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

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

          matejzero Matej Žerovnik added a comment - It seems like I can't tag you. New issue is opened under https://jira.mariadb.org/browse/MDEV-22872 .

          People

            vlad.lesin Vladislav Lesin
            dotmanila Jervin R
            Votes:
            2 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.