[MDEV-26884] mariabackup -prepare step on increment backup failed Created: 2021-10-22  Updated: 2022-01-05

Status: Open
Project: MariaDB Server
Component/s: mariabackup
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Radu MARTESCU Assignee: Unassigned
Resolution: Unresolved Votes: 1
Labels: None


 Description   

Hi,
Got an error with mariabackup during -prepare step on the increment backup.

Distribution:
Ver 15.1 Distrib 10.6.4-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2

I have a full backup without any partitioned tables and the increment backup has table pertionned.

  1. --------------
  2. full backup
  3. --------------
    mariabackup --defaults-file=/etc/mysql/my.cnf \
    --backup \
    --binlog-info \
    --target-dir=/var/lib/mysql/backup/full/ \
    ...
  1. ------------------
  2. incremental backup
  3. -------------------
    mariabackup --defaults-file=/etc/mysql/my.cnf \
    --backup \
    --binlog-info \
    --target-dir=/var/lib/mysql/backup/inc1/ \
    --incremental-basedir=/var/lib/mysql/backup/full/ \
    ....
  1. ----------------------
  2. 1- Prepare on full backup is OK
  3. -----------------------
    mariabackup --defaults-file=/etc/mysql/my.cnf \
    > --prepare \
    > --target-dir=/var/lib/mysql/backup/full
    mariabackup based on MariaDB server 10.6.4-MariaDB debian-linux-gnu (x86_64)
    [00] 2021-10-22 11:03:01 cd to /var/lib/mysql/backup/full/
    [00] 2021-10-22 11:03:01 open files limit requested 1024, set to 1024
    [00] 2021-10-22 11:03:01 This target seems to be not prepared yet.
    [00] 2021-10-22 11:03:01 mariabackup: using the following InnoDB configuration for recovery:
    [00] 2021-10-22 11:03:01 innodb_data_home_dir = .
    [00] 2021-10-22 11:03:01 innodb_data_file_path = ibdata1:128M:autoextend
    [00] 2021-10-22 11:03:01 innodb_log_group_home_dir = .
    [00] 2021-10-22 11:03:01 InnoDB: Using Linux native AIO
    [00] 2021-10-22 11:03:01 Starting InnoDB instance for recovery.
    [00] 2021-10-22 11:03:01 mariabackup: Using 104857600 bytes for buffer pool (set by --use-memory parameter)
    2021-10-22 11:03:01 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
    2021-10-22 11:03:01 0 [Note] InnoDB: Number of pools: 1
    2021-10-22 11:03:01 0 [Note] InnoDB: Using SSE4.2 crc32 instructions
    2021-10-22 11:03:01 0 [Note] InnoDB: Using Linux native AIO
    2021-10-22 11:03:01 0 [Note] InnoDB: Initializing buffer pool, total size = 104857600, chunk size = 104857600
    2021-10-22 11:03:01 0 [Note] InnoDB: Completed initialization of buffer pool
    2021-10-22 11:03:01 0 [Note] InnoDB: Starting crash recovery from checkpoint LSN=42161,42161
    [00] 2021-10-22 11:03:01 Last binlog file , position 0
    [00] 2021-10-22 11:03:01 completed OK!
  1. ----------------------
  2. 2 - Prepare on inc backup failed with this error:
  3. ----------------------
    mariabackup --defaults-file=/etc/mysql/my.cnf \
    > --prepare \
    > --target-dir=/var/lib/mysql/backup/full \
    > --incremental-dir=/var/lib/mysql/backup/inc1
    mariabackup based on MariaDB server 10.6.4-MariaDB debian-linux-gnu (x86_64)
    [00] 2021-10-22 11:06:15 incremental backup from 42161 is enabled.
    [00] 2021-10-22 11:06:15 cd to /var/lib/mysql/backup/full/
    [00] 2021-10-22 11:06:15 open files limit requested 1024, set to 1024
    [00] 2021-10-22 11:06:15 Renaming /var/lib/mysql/backup/inc1//KANNEL/DLR#P#2018_06_08.new to ./KANNEL/DLR#P#2018_06_08.ibd

mariabackup: Error on rename of '/var/lib/mysql/backup/inc1//KANNEL/DLR#P#2018_06_08.new' to './KANNEL/DLR#P#2018_06_08.ibd' (errno: 20 "Not a directory")
[00] FATAL ERROR: 2021-10-22 11:06:15 Can't rename /var/lib/mysql/backup/inc1//KANNEL/DLR#P#2018_06_08.new to ./KANNEL/DLR#P#2018_06_08.ibd errno 2

  1. file exist
    $ ls /var/lib/mysql/backup/inc1//KANNEL/DLR#P#2018_06_08.new
    /var/lib/mysql/backup/inc1//KANNEL/DLR#P#2018_06_08.new


 Comments   
Comment by Radu MARTESCU [ 2021-10-22 ]

Doing a full backup with table partitioned and then prepare it work fine

Comment by Radu MARTESCU [ 2021-10-22 ]

seams to have the same issue without partitioned table

mariabackup --defaults-file=/etc/mysql/my.cnf \
> --prepare \
> --target-dir=/var/lib/mysql/backup/full \
> --incremental-dir=/var/lib/mysql/backup/inc1
mariabackup based on MariaDB server 10.6.4-MariaDB debian-linux-gnu (x86_64)
[00] 2021-10-22 11:22:57 incremental backup from 42161 is enabled.
[00] 2021-10-22 11:22:57 cd to /var/lib/mysql/backup/full/
[00] 2021-10-22 11:22:57 open files limit requested 1024, set to 1024
[00] 2021-10-22 11:22:57 Renaming /var/lib/mysql/backup/inc1//radu/t1.new to ./radu/t1.ibd

mariabackup: Error on rename of '/var/lib/mysql/backup/inc1//radu/t1.new' to './radu/t1.ibd' (errno: 20 "Not a directory")
[00] FATAL ERROR: 2021-10-22 11:22:57 Can't rename /var/lib/mysql/backup/inc1//radu/t1.new to ./radu/t1.ibd errno 2

$ ls /var/lib/mysql/backup/inc1//radu/t1.new
/var/lib/mysql/backup/inc1//radu/t1.new

Comment by Radu MARTESCU [ 2021-10-26 ]

You can reproduce this very easy:
Take a full backup
Create a new database (so the full backup will not have this directory)
Take an incremental backup
Prepare on the increment backup will fail as it look on the full backup for the directory name of the new database -> it does not exist , so it fail

  • workaround: create before the directory for the database on the full backup destination
Generated at Thu Feb 08 09:48:41 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.