Debian Codegraph @

mysql-test/suite/group_replication/t/gr_inject_pipeline_error_remote_gtid.test

raw
1 ################################################################################
2 # BUG#21180035 - ADD SUPPORT TO SKIP GTIDS ON GROUP REPLICATION
3 #
4 # This test verifies that incase of an error on the pipeline due to remote
5 # transactions with specified GTIDs that cant be added to the to the
6 # group_gtid_executed set.
7 #
8 # Test:
9 # 0. The test requires two servers: M1 and M2.
10 # 1. Bootstrap start M1. Create table t1 for further testing.
11 # 2. Set DEBUG point in M2. Add a remote transaction on M1 for M2 so that the
12 # debug point is hit.
13 # 3. Check service_state of applier channel is OFF on M2.
14 # 4. Clean up.
15 ################################################################################
16
17 --source include/big_test.inc
18 --source include/have_debug.inc
19 --let $group_replication_group_name= 32e16c0b-01d2-11e6-a992-02420ef39c5b
20 --source include/have_group_replication_plugin.inc
21 --let $rpl_skip_group_replication_start= 1
22 --source include/group_replication.inc
23
24 --source include/start_and_bootstrap_group_replication.inc
25 CREATE TABLE t1 (i int PRIMARY KEY);
26
27 --let $rpl_connection_name= server2
28 --source include/rpl_connection.inc
29 --source include/start_group_replication.inc
30
31 SET @debug_saved= @@GLOBAL.DEBUG;
32 SET @@GLOBAL.DEBUG= '+d,unable_to_add_specified_gtid_for_remote_transaction';
33
34 SET SESSION sql_log_bin= 0;
35 call mtr.add_suppression("Unable to add gtid information to the group_gtid_executed set when gtid was provided for remote transactions");
36 call mtr.add_suppression("Fatal error during execution on the Applier process of Group Replication. The server will now leave the group.");
37 call mtr.add_suppression("Error at event handling! Got error: 1");
38 call mtr.add_suppression("Error. Leaving a group without being on one.");
39 call mtr.add_suppression("The server was automatically set into read only mode after an error was detected.");
40 call mtr.add_suppression("Skipping leave operation: concurrent attempt to leave the group is on-going.");
41 SET SESSION sql_log_bin= 1;
42
43 --let $rpl_connection_name= server1
44 --source include/rpl_connection.inc
45
46 # Add a remote transaction for server2 so that the debug point is hit.
47 --eval SET GTID_NEXT= "$group_replication_group_name:4"
48 INSERT INTO t1 VALUES(1);
49 SET GTID_NEXT='AUTOMATIC';
50
51 --let $rpl_connection_name= server2
52 --source include/rpl_connection.inc
53
54 --let $wait_condition= SELECT service_state="OFF" FROM performance_schema.replication_applier_status WHERE channel_name="group_replication_applier"
55 --source include/wait_condition.inc
56
57 --echo
58 --echo # Reset debug flag.
59 --echo #
60 --source include/stop_group_replication.inc
61 SET @@GLOBAL.DEBUG= @debug_saved;
62 --source include/start_group_replication.inc
63
64 # Cleanup
65
66 --let $rpl_connection_name= server1
67 --source include/rpl_connection.inc
68 DROP TABLE t1;
69 --source include/group_replication_end.inc