1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122
|
include/group_replication.inc
Warnings:
Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
Note #### Storing MySQL user name or password information in the connection metadata repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START REPLICA; see the 'START REPLICA Syntax' in the MySQL Manual for more information.
[connection server1]
SET sql_log_bin=0;
call mtr.add_suppression("Attempting backtrace");
call mtr.add_suppression("allocated tablespace *., old maximum was 0");
call mtr.add_suppression("Error in Log_event::read_log_event()");
call mtr.add_suppression("Buffered warning: Performance schema disabled");
SET sql_log_bin=1;
# Test case1: Set DEBUG POINT before binlog to make
# the first member crash for transaction
CREATE TABLE t1(i INT, a LONGBLOB, PRIMARY KEY(i)) ENGINE=INNODB;
BEGIN;
INSERT INTO t1 VALUES (3, REPEAT('a',2));;
INSERT INTO t1 VALUES (2, REPEAT('a',2));;
INSERT INTO t1 VALUES (1, REPEAT('a',2));;
COMMIT;
ERROR HY000: Lost connection to MySQL server during query
# Restart the crashed member
include/rpl_reconnect.inc
include/assert.inc [On server1, test the data will be rolled back after restart.]
include/rpl_sync.inc
# On the second member, test replication will work fine, and the data
# is not replicated
include/diff_tables.inc [server1:test.t1, server2:test.t1]
[connection server2]
include/gr_wait_for_member_state.inc
include/rpl_gr_wait_for_number_of_members.inc
[connection server1]
include/start_group_replication.inc
CREATE TABLE temp (i INT PRIMARY KEY) engine=INNODB;
INSERT INTO temp VALUES (1);
include/rpl_sync.inc
INSERT INTO temp VALUES (2);
include/rpl_sync.inc
include/diff_tables.inc [server1:test.temp, server2:test.temp]
DROP TABLE t1;
DROP TABLE temp;
include/rpl_sync.inc
# Test case2: Set DEBUG POINT after binlog, and before the data
# is committed to make crash for transaction
CREATE TABLE t1(i INT, a LONGBLOB, PRIMARY KEY(i)) ENGINE=INNODB;
BEGIN;
INSERT INTO t1 VALUES (3, REPEAT('a',2));;
INSERT INTO t1 VALUES (2, REPEAT('a',2));;
INSERT INTO t1 VALUES (1, REPEAT('a',2));;
COMMIT;
ERROR HY000: Lost connection to MySQL server during query
# Restart the crashed member
include/rpl_reconnect.inc
include/assert.inc [On server1, test the data will be recovered after the server1 restart.]
# On the second member, test that the replication is working fine, and
# data gets replicated here.
include/diff_tables.inc [server1:test.t1, server2:test.t1]
[connection server2]
include/gr_wait_for_member_state.inc
include/rpl_gr_wait_for_number_of_members.inc
[connection server1]
include/start_group_replication.inc
CREATE TABLE temp (i INT PRIMARY KEY) engine=INNODB;
INSERT INTO temp VALUES (1);
include/rpl_sync.inc
INSERT INTO temp VALUES (2);
include/rpl_sync.inc
include/diff_tables.inc [server1:test.temp, server2:test.temp]
DROP TABLE t1;
DROP TABLE temp;
include/rpl_sync.inc
CREATE TABLE t1(i INT AUTO_INCREMENT PRIMARY KEY, a LONGBLOB) ENGINE=INNODB;
# Test case3: Set DEBUG POINT after binlogging half of the transaction and
# then crash the member and followed by restarting the member.
set AUTOCOMMIT=0;
BEGIN;
INSERT INTO t1 (a) VALUES ( REPEAT('a',6144));
INSERT INTO t1 (a) VALUES ( REPEAT('a',6144));
INSERT INTO t1 (a) VALUES ( REPEAT('a',6144));
INSERT INTO t1 (a) VALUES ( REPEAT('a',6144));
INSERT INTO t1 (a) VALUES ( REPEAT('a',6144));
INSERT INTO t1 (a) VALUES ( REPEAT('a',6144));
INSERT INTO t1 (a) VALUES ( REPEAT('a',6144));
INSERT INTO t1 (a) VALUES ( REPEAT('a',6144));
INSERT INTO t1 (a) VALUES ( REPEAT('a',6144));
INSERT INTO t1 (a) VALUES ( REPEAT('a',6144));
INSERT INTO t1 (a) VALUES ( REPEAT('a',6144));
INSERT INTO t1 (a) VALUES ( REPEAT('a',6144));
INSERT INTO t1 (a) VALUES ( REPEAT('a',6144));
INSERT INTO t1 (a) VALUES ( REPEAT('a',6144));
INSERT INTO t1 (a) VALUES ( REPEAT('a',6144));
INSERT INTO t1 (a) VALUES ( REPEAT('a',6144));
INSERT INTO t1 (a) VALUES ( REPEAT('a',6144));
INSERT INTO t1 (a) VALUES ( REPEAT('a',6144));
INSERT INTO t1 (a) VALUES ( REPEAT('a',6144));
INSERT INTO t1 (a) VALUES ( REPEAT('a',6144));
INSERT INTO t1 (a) VALUES ( REPEAT('a',6144));
INSERT INTO t1 (a) VALUES ( REPEAT('a',6144));
INSERT INTO t1 (a) VALUES ( REPEAT('a',6144));
INSERT INTO t1 (a) VALUES ( REPEAT('a',6144));
COMMIT;
ERROR HY000: Lost connection to MySQL server during query
# Restart the crashed member
include/rpl_reconnect.inc
# Test the data will not be recovered successfully
# after the crashed first member restarts.
include/assert.inc [On server1, test the data will be recovered after the server1 restart.]
[connection server2]
include/gr_wait_for_member_state.inc
include/rpl_gr_wait_for_number_of_members.inc
[connection server1]
include/start_group_replication.inc
include/diff_tables.inc [server1:test.t1, server2:test.t1]
include/assert.inc [The table has 24 rows after the restart.]
CREATE TABLE temp (i INT PRIMARY KEY) engine=INNODB;
INSERT INTO temp VALUES (1);
include/rpl_sync.inc
INSERT INTO temp VALUES (2);
include/rpl_sync.inc
include/diff_tables.inc [server1:test.temp, server2:test.temp]
DROP TABLE t1;
DROP TABLE temp;
include/group_replication_end.inc
|