Debian Codegraph @

mysql-test/suite/group_replication/t/gr_inject_pipeline_error_local_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 local
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 one server: M1.
10 # 1. Bootstrap start M1. Create table t1 for further testing.
11 # 2. Set a DEBUG point. Add a local transaction for M1 so that the debug point
12 # is hit.
13 # 3. Check service_state of applier channel is OFF.
14 # 4. Clean up.
15 ################################################################################
16
17 --source include/not_valgrind.inc
18 --source include/have_debug.inc
19 --let $group_replication_group_name= 32e1761a-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 --let $rpl_connection_name= server1
25 --source include/rpl_connection.inc
26
27 --source include/start_and_bootstrap_group_replication.inc
28 CREATE TABLE t1 (i int PRIMARY KEY);
29
30 SET SESSION sql_log_bin= 0;
31 call mtr.add_suppression("Unable to add gtid information to the group_gtid_executed set when gtid was provided for local transactions");
32 call mtr.add_suppression("Error at event handling! Got error: 1");
33 call mtr.add_suppression("Fatal error during execution on the Applier process of Group Replication. The server will now leave the group.");
34 call mtr.add_suppression("Error. Leaving a group without being on one.");
35 call mtr.add_suppression("The server was automatically set into read only mode after an error was detected.");
36 call mtr.add_suppression("Skipping leave operation: concurrent attempt to leave the group is on-going.");
37 call mtr.add_suppression("Due to a plugin error, some transactions were unable to be certified and will now rollback.");
38 call mtr.add_suppression("Error when trying to unblock non certified or consistent transactions. Check for consistency errors when restarting the service");
39 call mtr.add_suppression("Error while waiting for conflict detection procedure to finish on session.*");
40 call mtr.add_suppression("Run function 'before_commit' in plugin 'group_replication' failed");
41 call mtr.add_suppression("Error when trying to unblock non certified transactions.*");
42 SET SESSION sql_log_bin= 1;
43
44 # Add a local transaction for server1 so that the debug point is hit.
45 SET @debug_saved= @@GLOBAL.DEBUG;
46 SET @@GLOBAL.DEBUG= '+d,unable_to_add_specified_gtid_for_local_transaction';
47
48 --eval SET GTID_NEXT= "$group_replication_group_name:4"
49 --error 0, ER_TRANSACTION_ROLLBACK_DURING_COMMIT, ER_RUN_HOOK_ERROR
50 INSERT INTO t1 VALUES(1);
51 SET GTID_NEXT='AUTOMATIC';
52
53 --let $wait_condition= SELECT service_state="OFF" FROM performance_schema.replication_applier_status WHERE channel_name="group_replication_applier"
54 --source include/wait_condition.inc
55
56 --echo
57 --echo # Reset debug flag.
58 --echo #
59 --source include/stop_group_replication.inc
60 SET @@GLOBAL.DEBUG= @debug_saved;
61 --source include/start_and_bootstrap_group_replication.inc
62
63 # Cleanup
64
65 --let $rpl_connection_name= server1
66 --source include/rpl_connection.inc
67 DROP TABLE t1;
68 --source include/group_replication_end.inc