| 1 |
--source include/galera_cluster.inc |
| 2 |
--source include/have_mariabackup.inc |
| 3 |
|
| 4 |
# Save original auto_increment_offset values. |
| 5 |
--let $node_1=node_1 |
| 6 |
--let $node_2=node_2 |
| 7 |
--source include/auto_increment_offset_save.inc |
| 8 |
|
| 9 |
# |
| 10 |
--echo # Case 1 : MariaBackup SST |
| 11 |
# |
| 12 |
--connection node_1 |
| 13 |
CREATE TABLE t(i INT NOT NULL PRIMARY KEY) ENGINE INNODB; |
| 14 |
INSERT INTO t VALUES(1); |
| 15 |
# |
| 16 |
# In default settings donor should not desync |
| 17 |
# |
| 18 |
--echo # Restart node_2, force SST. |
| 19 |
--connection node_2 |
| 20 |
--source include/shutdown_mysqld.inc |
| 21 |
--remove_file $MYSQLTEST_VARDIR/mysqld.2/data/grastate.dat |
| 22 |
|
| 23 |
--connection node_1 |
| 24 |
--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size' |
| 25 |
--source include/wait_condition.inc |
| 26 |
|
| 27 |
--connection node_2 |
| 28 |
--echo Starting server ... |
| 29 |
let $restart_noprint=2; |
| 30 |
--source include/start_mysqld.inc |
| 31 |
|
| 32 |
--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; |
| 33 |
--source include/wait_condition.inc |
| 34 |
|
| 35 |
--let $wait_condition = SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready'; |
| 36 |
--source include/wait_condition.inc |
| 37 |
|
| 38 |
--connection node_1 |
| 39 |
let SEARCH_FILE = $MYSQLTEST_VARDIR/log/mysqld.1.err; |
| 40 |
--echo # Both should return NOT FOUND as we have mariabackup with backup locks |
| 41 |
let SEARCH_PATTERN = Desyncing and pausing the provider; |
| 42 |
--source include/search_pattern_in_file.inc |
| 43 |
let SEARCH_PATTERN = Resuming and resyncing the provider; |
| 44 |
--source include/search_pattern_in_file.inc |
| 45 |
|
| 46 |
# |
| 47 |
# Now we set wsrep_mode = BF_ABORT_MARIABACKUP |
| 48 |
# |
| 49 |
--connection node_1 |
| 50 |
SET GLOBAL wsrep_mode = "BF_ABORT_MARIABACKUP"; |
| 51 |
|
| 52 |
--echo # Restart node_2, force SST. |
| 53 |
--connection node_2 |
| 54 |
--source include/shutdown_mysqld.inc |
| 55 |
--remove_file $MYSQLTEST_VARDIR/mysqld.2/data/grastate.dat |
| 56 |
|
| 57 |
--connection node_1 |
| 58 |
--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size' |
| 59 |
--source include/wait_condition.inc |
| 60 |
INSERT INTO t VALUES(2); |
| 61 |
|
| 62 |
--connection node_2 |
| 63 |
--echo Starting server ... |
| 64 |
let $restart_noprint=2; |
| 65 |
--source include/start_mysqld.inc |
| 66 |
|
| 67 |
--connection node_2 |
| 68 |
--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; |
| 69 |
--source include/wait_condition.inc |
| 70 |
|
| 71 |
--let $wait_condition = SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready'; |
| 72 |
--source include/wait_condition.inc |
| 73 |
|
| 74 |
# Restore original auto_increment_offset values. |
| 75 |
--source include/auto_increment_offset_restore.inc |
| 76 |
|
| 77 |
--connection node_1 |
| 78 |
let SEARCH_FILE = $MYSQLTEST_VARDIR/log/mysqld.1.err; |
| 79 |
--echo # Both should return NOT FOUND as we have mariabackup with backup locks |
| 80 |
let SEARCH_PATTERN = Desyncing and pausing the provider; |
| 81 |
--source include/search_pattern_in_file.inc |
| 82 |
let SEARCH_PATTERN = Resuming and resyncing the provider; |
| 83 |
--source include/search_pattern_in_file.inc |
| 84 |
SET GLOBAL wsrep_mode = ""; |
| 85 |
DROP TABLE t; |
| 86 |
# |
| 87 |
--echo # Case 2: MariaBackup backup from node_2 |
| 88 |
# |
| 89 |
--connection node_1 |
| 90 |
CREATE TABLE t(i INT NOT NULL PRIMARY KEY) ENGINE INNODB; |
| 91 |
INSERT INTO t VALUES(1),(2),(3),(4),(5); |
| 92 |
|
| 93 |
--connection node_2 |
| 94 |
SET GLOBAL wsrep_mode = ""; |
| 95 |
SELECT @@wsrep_mode; |
| 96 |
let $targetdir=$MYSQLTEST_VARDIR/tmp/backup; |
| 97 |
--let $backup_log=$MYSQLTEST_VARDIR/tmp/backup.log |
| 98 |
--disable_result_log |
| 99 |
--exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --defaults-group-suffix=.2 --backup --target-dir=$targetdir > $backup_log 2>&1; |
| 100 |
--enable_result_log |
| 101 |
|
| 102 |
let SEARCH_FILE = $MYSQLTEST_VARDIR/log/mysqld.2.err; |
| 103 |
--echo # Both should return FOUND 1 as we have backup |
| 104 |
let SEARCH_PATTERN = Desyncing and pausing the provider; |
| 105 |
--source include/search_pattern_in_file.inc |
| 106 |
let SEARCH_PATTERN = Resuming and resyncing the provider; |
| 107 |
--source include/search_pattern_in_file.inc |
| 108 |
# |
| 109 |
# Now we set wsrep_mode = BF_ABORT_MARIABACKUP |
| 110 |
# |
| 111 |
SET GLOBAL wsrep_mode = "BF_ABORT_MARIABACKUP"; |
| 112 |
SELECT @@wsrep_mode; |
| 113 |
let $targetdir=$MYSQLTEST_VARDIR/tmp/backup2; |
| 114 |
--let $backup_log=$MYSQLTEST_VARDIR/tmp/backup2.log |
| 115 |
--disable_result_log |
| 116 |
--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; |
| 117 |
--enable_result_log |
| 118 |
|
| 119 |
let SEARCH_FILE = $MYSQLTEST_VARDIR/log/mysqld.2.err; |
| 120 |
--echo # Both should return FOUND 2 because both backups do desync but on different points |
| 121 |
let SEARCH_PATTERN = Desyncing and pausing the provider; |
| 122 |
--source include/search_pattern_in_file.inc |
| 123 |
let SEARCH_PATTERN = Resuming and resyncing the provider; |
| 124 |
--source include/search_pattern_in_file.inc |
| 125 |
--echo # Should return FOUND 1 as server did not desync at BLOCK_DDL |
| 126 |
let SEARCH_PATTERN = Server not desynched from group at BLOCK_DDL because WSREP_MODE_BF_MARIABACKUP is used.; |
| 127 |
--source include/search_pattern_in_file.inc |
| 128 |
--echo # Should return FOUND 1 as server did desync and pause at BLOCK_COMMIT |
| 129 |
let SEARCH_PATTERN = Server desynched from group during BACKUP STAGE BLOCK_COMMIT.; |
| 130 |
--source include/search_pattern_in_file.inc |
| 131 |
|
| 132 |
SET GLOBAL wsrep_mode = DEFAULT; |
| 133 |
|
| 134 |
--connection node_1 |
| 135 |
DROP TABLE t; |
| 136 |
|
| 137 |
--source include/auto_increment_offset_restore.inc |
| 138 |
|
| 139 |
--source include/galera_end.inc |