Xtrabackup - 8.0.35-31 - Does not apply the incremental

Hi,

I ran the full backup command: xtrabackup --backup --target-dir=/dados/percona/base/

I created a database B with a test table.

I ran the command for the incremental backup: xtrabackup --backup --target-dir=/dados/percona/inc1 --incremental-basedir=/dados/percona/base

I prepared the full backup and then I prepared the incremental backup.

xtrabackup --prepare --apply-log-only --target-dir=/dados/percona/base

2024-08-14T19:10:34.498009-03:00 0 [Note] [MY-012980] [InnoDB] Shutdown completed; log sequence number 20932320
2024-08-14T19:10:34.503028-03:00 0 [Note] [MY-011825] [Xtrabackup] completed OK!

xtrabackup --prepare --target-dir=/dados/percona/base --incremental-basedir=/dados/percona/inc1

2024-08-14T19:11:37.034280-03:00 0 [Note] [MY-012980] [InnoDB] Shutdown completed; log sequence number 20933142
2024-08-14T19:11:37.038723-03:00 0 [Note] [MY-011825] [Xtrabackup] completed OK!

When restoring the backup, table B is not in the database.

Am I doing something wrong or is there a bug in the xtrabackup version?

Infos:

MySQL version: 8.0.39
xtrabackup version 8.0.35-31
Ubuntu 22.04.4 LTS

base/xtrabackup_checkpoints
backup_type = log-applied
from_lsn = 0
to_lsn = 20981409
last_lsn = 20981409
flushed_lsn = 20981409
redo_memory = 0
redo_frames = 0

inc1/xtrabackup_checkpoints
backup_type = incremental
from_lsn = 20981409
to_lsn = 20998433
last_lsn = 20998433
flushed_lsn = 20998433
redo_memory = 0
redo_frames = 0

ls -lah base/
total 90M
drwxr-x— 8 root root 4.0K Aug 14 18:50 .
drwxr-xr-x 4 root root 30 Aug 14 18:44 …
drwxr-x— 2 root root 29 Aug 14 18:43 a
-rw-r----- 1 root root 447 Aug 14 18:43 backup-my.cnf
-rw-r----- 1 root root 157 Aug 14 18:43 binlog.000016
-rw-r----- 1 root root 16 Aug 14 18:43 binlog.index
-rw-r----- 1 root root 3.4K Aug 14 18:43 ib_buffer_pool
-rw-r----- 1 root root 12M Aug 14 18:50 ibdata1
-rw-r----- 1 root root 12M Aug 14 18:50 ibtmp1
drwxr-x— 2 root root 6 Aug 14 18:50 ‘#innodb_redo
drwxr-x— 2 root root 143 Aug 14 18:43 mysql
-rw-r----- 1 root root 25M Aug 14 18:43 mysql.ibd
drwxr-x— 2 root root 8.0K Aug 14 18:43 performance_schema
drwxr-x— 2 root root 36 Aug 14 18:43 sys
drwxr-x— 2 root root 28 Aug 14 18:43 tmp
-rw-r----- 1 root root 16M Aug 14 18:43 undo_001
-rw-r----- 1 root root 16M Aug 14 18:43 undo_002
-rw-r----- 1 root root 18 Aug 14 18:43 xtrabackup_binlog_info
-rw-r----- 1 root root 132 Aug 14 18:50 xtrabackup_checkpoints
-rw-r----- 1 root root 473 Aug 14 18:43 xtrabackup_info
-rw-r----- 1 root root 8.0M Aug 14 18:45 xtrabackup_logfile
-rw-r----- 1 root root 39 Aug 14 18:50 xtrabackup_tablespaces

ls -lah inc1/
total 1.1M
drwxr-x— 8 root root 4.0K Aug 14 18:44 .
drwxr-xr-x 4 root root 30 Aug 14 18:44 …
drwxr-x— 2 root root 59 Aug 14 18:44 a
drwxr-x— 2 root root 61 Aug 14 18:44 b
-rw-r----- 1 root root 447 Aug 14 18:44 backup-my.cnf
-rw-r----- 1 root root 157 Aug 14 18:44 binlog.000017
-rw-r----- 1 root root 16 Aug 14 18:44 binlog.index
-rw-r----- 1 root root 3.4K Aug 14 18:44 ib_buffer_pool
-rw-r----- 1 root root 48K Aug 14 18:44 ibdata1.delta
-rw-r----- 1 root root 64 Aug 14 18:44 ibdata1.meta
drwxr-x— 2 root root 143 Aug 14 18:44 mysql
-rw-r----- 1 root root 640K Aug 14 18:44 mysql.ibd.delta
-rw-r----- 1 root root 73 Aug 14 18:44 mysql.ibd.meta
drwxr-x— 2 root root 8.0K Aug 14 18:44 performance_schema
drwxr-x— 2 root root 61 Aug 14 18:44 sys
drwxr-x— 2 root root 28 Aug 14 18:44 tmp
-rw-r----- 1 root root 128K Aug 14 18:44 undo_001.delta
-rw-r----- 1 root root 69 Aug 14 18:44 undo_001.meta
-rw-r----- 1 root root 176K Aug 14 18:44 undo_002.delta
-rw-r----- 1 root root 69 Aug 14 18:44 undo_002.meta
-rw-r----- 1 root root 18 Aug 14 18:44 xtrabackup_binlog_info
-rw-r----- 1 root root 139 Aug 14 18:44 xtrabackup_checkpoints
-rw-r----- 1 root root 521 Aug 14 18:44 xtrabackup_info
-rw-r----- 1 root root 2.5K Aug 14 18:44 xtrabackup_logfile
-rw-r----- 1 root root 39 Aug 14 18:44 xtrabackup_tablespaces

Percona has not released an 8.0.39. Are you using community MySQL? Are you aware of the serious bug back in 8.0.38? I would repeat your test on the latest Percona 8.0.37 and verify these results firstly.

Hi Mattewb,

Find the problem.

I was using the command incorrectly but it didn’t warn me.

Wrong: xtrabackup --prepare --target-dir=/dados/percona/base –incremental-basedir=/dados/percona/inc1

Correct: xtrabackup --prepare --target-dir=/dados/percona/base –incremental-dir=/dados/percona/inc1

Questions:

I’m using the latest version of the community MySQL 8.0

And the latest version of xtrabackup is 8.0.35-31, as can be seen on the website.

Thanks!