1
0
mirror of https://github.com/MariaDB/server.git synced 2025-09-13 13:47:59 +03:00
Files
mariadb/mysql-test/suite/galera/t/galera_bf_abort_mariabackup.test
2025-04-02 06:33:39 +02:00

140 lines
5.1 KiB
Plaintext

--source include/galera_cluster.inc
--source include/have_mariabackup.inc
# Save original auto_increment_offset values.
--let $node_1=node_1
--let $node_2=node_2
--source include/auto_increment_offset_save.inc
#
--echo # Case 1 : MariaBackup SST
#
--connection node_1
CREATE TABLE t(i INT NOT NULL PRIMARY KEY) ENGINE INNODB;
INSERT INTO t VALUES(1);
#
# In default settings donor should not desync
#
--echo # Restart node_2, force SST.
--connection node_2
--source include/shutdown_mysqld.inc
--remove_file $MYSQLTEST_VARDIR/mysqld.2/data/grastate.dat
--connection node_1
--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
--source include/wait_condition.inc
--connection node_2
--echo Starting server ...
let $restart_noprint=2;
--source include/start_mysqld.inc
--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
--source include/wait_condition.inc
--let $wait_condition = SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
--source include/wait_condition.inc
--connection node_1
let SEARCH_FILE = $MYSQLTEST_VARDIR/log/mysqld.1.err;
--echo # Both should return NOT FOUND as we have mariabackup with backup locks
let SEARCH_PATTERN = Desyncing and pausing the provider;
--source include/search_pattern_in_file.inc
let SEARCH_PATTERN = Resuming and resyncing the provider;
--source include/search_pattern_in_file.inc
#
# Now we set wsrep_mode = BF_ABORT_MARIABACKUP
#
--connection node_1
SET GLOBAL wsrep_mode = "BF_ABORT_MARIABACKUP";
--echo # Restart node_2, force SST.
--connection node_2
--source include/shutdown_mysqld.inc
--remove_file $MYSQLTEST_VARDIR/mysqld.2/data/grastate.dat
--connection node_1
--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
--source include/wait_condition.inc
INSERT INTO t VALUES(2);
--connection node_2
--echo Starting server ...
let $restart_noprint=2;
--source include/start_mysqld.inc
--connection node_2
--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
--source include/wait_condition.inc
--let $wait_condition = SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
--source include/wait_condition.inc
# Restore original auto_increment_offset values.
--source include/auto_increment_offset_restore.inc
--connection node_1
let SEARCH_FILE = $MYSQLTEST_VARDIR/log/mysqld.1.err;
--echo # Both should return NOT FOUND as we have mariabackup with backup locks
let SEARCH_PATTERN = Desyncing and pausing the provider;
--source include/search_pattern_in_file.inc
let SEARCH_PATTERN = Resuming and resyncing the provider;
--source include/search_pattern_in_file.inc
SET GLOBAL wsrep_mode = "";
DROP TABLE t;
#
--echo # Case 2: MariaBackup backup from node_2
#
--connection node_1
CREATE TABLE t(i INT NOT NULL PRIMARY KEY) ENGINE INNODB;
INSERT INTO t VALUES(1),(2),(3),(4),(5);
--connection node_2
SET GLOBAL wsrep_mode = "";
SELECT @@wsrep_mode;
let $targetdir=$MYSQLTEST_VARDIR/tmp/backup;
--let $backup_log=$MYSQLTEST_VARDIR/tmp/backup.log
--disable_result_log
--exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --defaults-group-suffix=.2 --backup --target-dir=$targetdir > $backup_log 2>&1;
--enable_result_log
let SEARCH_FILE = $MYSQLTEST_VARDIR/log/mysqld.2.err;
--echo # Both should return FOUND 1 as we have backup
let SEARCH_PATTERN = Desyncing and pausing the provider;
--source include/search_pattern_in_file.inc
let SEARCH_PATTERN = Resuming and resyncing the provider;
--source include/search_pattern_in_file.inc
#
# Now we set wsrep_mode = BF_ABORT_MARIABACKUP
#
SET GLOBAL wsrep_mode = "BF_ABORT_MARIABACKUP";
SELECT @@wsrep_mode;
let $targetdir=$MYSQLTEST_VARDIR/tmp/backup2;
--let $backup_log=$MYSQLTEST_VARDIR/tmp/backup2.log
--disable_result_log
--exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --defaults-group-suffix=.2 --backup --target-dir=$targetdir --mysqld-args --wsrep-mode="BF_ABORT_MARIABACKUP" > $backup_log 2>&1;
--enable_result_log
let SEARCH_FILE = $MYSQLTEST_VARDIR/log/mysqld.2.err;
--echo # Both should return FOUND 2 because both backups do desync but on different points
let SEARCH_PATTERN = Desyncing and pausing the provider;
--source include/search_pattern_in_file.inc
let SEARCH_PATTERN = Resuming and resyncing the provider;
--source include/search_pattern_in_file.inc
--echo # Should return FOUND 1 as server did not desync at BLOCK_DDL
let SEARCH_PATTERN = Server not desynched from group at BLOCK_DDL because WSREP_MODE_BF_MARIABACKUP is used.;
--source include/search_pattern_in_file.inc
--echo # Should return FOUND 1 as server did desync and pause at BLOCK_COMMIT
let SEARCH_PATTERN = Server desynched from group during BACKUP STAGE BLOCK_COMMIT.;
--source include/search_pattern_in_file.inc
SET GLOBAL wsrep_mode = DEFAULT;
--connection node_1
DROP TABLE t;
--source include/auto_increment_offset_restore.inc
--source include/galera_end.inc