[MDEV-29943] MariaBackup loses a DML operation after server restart Created: 2022-11-03  Updated: 2023-04-27

Status: Open
Project: MariaDB Server
Component/s: mariabackup, Storage Engine - InnoDB
Affects Version/s: 10.3, 10.4
Fix Version/s: 10.4

Type: Bug Priority: Minor
Reporter: Elena Stepanova Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: not-10.5+

Issue Links:
Relates
relates to MDEV-21403 mariabackup: Assertion recv_sys.mlog... Open

 Description   

Set to minor because I could only reproduce it on 10.3/10.4.

--source include/have_innodb.inc
 
CREATE TABLE t (pk INT PRIMARY KEY) ENGINE=InnoDB ROW_FORMAT=COMPRESSED;
INSERT INTO t VALUES (1),(2);
 
--source include/restart_mysqld.inc
 
DELETE FROM t;
 
--echo # Running backup
--exec $XTRABACKUP --backup --target-dir=$MYSQL_TMP_DIR/mbackup_backup --protocol=tcp --port=$MASTER_MYPORT --user=root
--echo # Running prepare
--exec $XTRABACKUP --prepare --target-dir=$MYSQL_TMP_DIR/mbackup_backup
--echo # Running restore
--exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --copy-back --datadir=$MYSQL_TMP_DIR/mbackup_restore --target-dir=$MYSQL_TMP_DIR/mbackup_backup
--echo # Restarting on the restored datadir
 
--let $restart_parameters= --datadir=$MYSQL_TMP_DIR/mbackup_restore
--source include/restart_mysqld.inc
SELECT * FROM t;

10.3 e7be2d31

CREATE TABLE t (pk INT PRIMARY KEY) ENGINE=InnoDB ROW_FORMAT=COMPRESSED;
INSERT INTO t VALUES (1),(2);
DELETE FROM t;
# Running backup
# Running prepare
# Running restore
# Restarting on the restored datadir
SELECT * FROM t;
pk
1
2

So, even though the backup was run after the DELETE, it still contains the data in the table.

Reproducible on 10.3 and 10.4, could not reproduce 10.5+.

It is a race condition, even though not with the client connection, because if I put a sleep between DELETE and backup, it is no longer reproducible.



 Comments   
Comment by Marko Mäkelä [ 2022-11-04 ]

This looks possibly related to MDEV-21403 and potentially fixed by MDEV-12353.

Comment by Angelique Sklavounos (Inactive) [ 2023-01-25 ]

Sorry, please disregard commit 943989c9ef9b7d01333ad14a09547585666c9eeb, this was meant for MDEV-29934.

Generated at Thu Feb 08 10:12:27 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.