xtrabackup --move-back produces malformed binlog.index entry

Description

binlog.index file should contain a list of:

  1. paths of binlog files relative to the data directory

  2. absolute paths of binlog files

however, it produces an entry that is a filename (neither relative nor absolute path)

Steps to reproduce:

  1. Start PS instance

  2. CREATE DATABASE test; USE test;

  3. CREATE TABLE t1 (a int);

  4. FLUSH BINARY LOGS;

  5. INSERT INTO t1 VALUES (0);

  6. Do backup: xtrabackup --backup --target-dir=/home/kamil/repo/ps/8.0/install/backup

  7. Prepare the backup: xtrabackup --prepare --target-dir=/home/kamil/repo/ps/8.0/install/backup

 

Case 1:

  1. copy-back/move-back: xtrabackup -log-bin=bin-logs/binlog --copy-back --target-dir=/home/kamil/repo/ps/8.0/install/backup --datadir=/home/kamil/repo/ps/8.0/install/ps-node/dn1

datadir/bin-logs/binlog.index file is created. It contains entry like ./binlog.000001 instead of ./bin-logs/binlog.000001

 

Case 2:

  1. pass an absolute binlog path that is descendant of the datadir
    xtrabackup --log-bin=/home/kamil/repo/ps/8.0/install/ps-node/dn1/bin-logs/binlog --copy-back --force-non-empty-directories --target-dir=/home/kamil/repo/ps/8.0/install/backup --datadir=/home/kamil/repo/ps/8.0/install/ps-node/dn1/

    datadir/bin-logs/binlog.index file is created. It contains entry like binlog.000001 instead of ./bin-logs/binlog.000001

 

Please note that despite of wrong entry in the index file, the server can find and process it in queries like SHOW BINARY LOGS or SHOW BINLOG EVENTS IN. However, binlog_utils_udf plugin is affected (see PXC-4638). I will fix the plugin to handle binlog files in index in the same way as the server code does, but in my opinion PXB should not produce malformed index file anyway.

Environment

None

Attachments

1

Activity

Kamil Holubicki 
April 23, 2025 at 4:45 PM

Proposed patch

Details

Assignee

Reporter

Needs QA

Affects versions

Priority

Created April 23, 2025 at 4:40 PM
Updated May 12, 2025 at 8:37 AM