1
0
mirror of https://github.com/MariaDB/server.git synced 2025-09-13 13:47:59 +03:00

MDEV-32932 Port backup features from ES

Added support to BACKUP STAGE to maria-backup

This is a port of the code from ES 10.6
See MDEV-5336 for backup stages description.

The following old options are not supported by the new code:
--rsync             ; This is because rsync will not work on tables
                      that are in used.
--no-backup-locks   ; This is disabled as mariadb-backup will always
                      use backup locks for better performance.
This commit is contained in:
Monty
2023-12-03 14:09:43 +02:00
parent d7c943b363
commit 1c55b845e0
116 changed files with 6251 additions and 827 deletions

View File

@@ -0,0 +1,49 @@
# Test for copying log tables tail
--source include/have_aria.inc
--source include/have_debug.inc
--let $targetdir=$MYSQLTEST_VARDIR/tmp/backup
CREATE TABLE t(i INT)
ENGINE ARIA TRANSACTIONAL=1 ROW_FORMAT=PAGE PAGE_CHECKSUM=1;
--let $general_log_old = `SELECT @@global.general_log`
--let $log_output_old = `SELECT @@global.log_output`
SET GLOBAL general_log = 1;
SET GLOBAL log_output = 'TABLE';
INSERT INTO t VALUES (1);
--replace_column 1 TIMESTAMP 2 USER_HOST 3 THREAD_ID 5 Query
--sorted_result
SELECT * FROM mysql.general_log
WHERE argument LIKE "INSERT INTO %" AND
(command_type = "Query" OR command_type = "Execute") ;
--echo # Insert new row into general_log table after it has been copied on BLOCK_DDL.
--let after_stage_block_ddl=INSERT INTO test.t VALUES (2)
--echo # Backup to dir.
--disable_result_log
--exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --parallel=10 --target-dir=$targetdir --dbug=+d,mariabackup_events
--enable_result_log
--echo # Xtrabackup prepare.
--disable_result_log
--exec $XTRABACKUP --prepare --target-dir=$targetdir
--source include/restart_and_restore.inc
--enable_result_log
--replace_column 1 TIMESTAMP 2 USER_HOST 3 THREAD_ID 5 Query
--sorted_result
SELECT * FROM mysql.general_log
WHERE argument LIKE "INSERT INTO %" AND
(command_type = "Query" OR command_type = "Execute") ;
--rmdir $targetdir
DROP TABLE t;
--disable_query_log
--eval SET GLOBAL general_log = $general_log_old
--eval SET GLOBAL log_output = $log_output_old
--enable_query_log