Debian Codegraph @

mysql-test/suite/group_replication/r/gr_primary_mode_group_operations_26_1.result

raw
1 include/group_replication.inc [rpl_server_count=3]
2 Warnings:
3 Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
4 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.
5 [connection server1]
6
7 # 1. Multi Primary
8
9 # 1.1. On server1 enable group_replication_block_group_action debug
10 # point
11 set session sql_log_bin=0;
12 call mtr.add_suppression("Error while executing a group configuration operation: This operation was locally aborted and for that reason terminated.");
13 call mtr.add_suppression("The function 'group_replication_set_as_primary' failed. Primary assigned for election left the group, this operation will be aborted*");
14 set session sql_log_bin=1;
15 SET @@GLOBAL.DEBUG= '+d,group_replication_block_group_action';
16
17 # 1.2. On server2 execute action to change to single primary with
18 # server1 as primary
19 [connection server2]
20 set session sql_log_bin=0;
21 call mtr.add_suppression("Error while executing a group configuration operation: This operation was locally aborted and for that reason terminated.");
22 set session sql_log_bin=1;
23 set session sql_log_bin=0;
24 call mtr.add_suppression("The function 'group_replication_switch_to_single_primary_mode' failed. Primary assigned for election left the group, this operation will be aborted.");
25 set session sql_log_bin=1;
26 SELECT group_replication_switch_to_single_primary_mode("MEMBER1_UUID");
27
28 # 1.3. Verify that server2 is checking group pre-conditions
29 [connection server_2]
30 include/assert.inc [stage/group_rpl/Single-primary Switch: checking group pre-conditions]
31
32 # 1.4. Stop server 1
33 [connection server_1]
34 STOP GROUP_REPLICATION;
35 [connection server_2]
36 include/rpl_gr_wait_for_number_of_members.inc
37 [connection server1]
38 SET DEBUG_SYNC= "now SIGNAL signal.action_continue";
39 SET @@GLOBAL.DEBUG= '-d,group_replication_block_group_action';
40 [connection server_1]
41 include/assert_grep.inc [Found the expected error about the operation abort]
42 include/assert.inc [group_replication_enforce_update_everywhere_checks is ON]
43 include/assert.inc [The single primary mode should be 0 here.]
44
45 # 1.5. Reap action to switch to single primary and it returns error as
46 # server1 was killed
47 [connection server2]
48 ERROR HY000: The function 'group_replication_switch_to_single_primary_mode' failed. Primary assigned for election left the group, this operation will be aborted. No primary election was invoked under this operation.
49
50 # 1.6. Add suppression on server3 for action failure
51 [connection server3]
52 set session sql_log_bin=0;
53 call mtr.add_suppression("Error while executing a group configuration operation: Primary assigned for election left the group, this operation will be aborted.");
54 set session sql_log_bin=1;
55
56 # 1.7. Confirm that group replication is on Multi primary server
57 include/gr_assert_multi_primary_mode.inc
58 [connection server2]
59 include/gr_assert_multi_primary_mode.inc
60
61 # 1.8. Cleanup to run Single Primary test
62 [connection server1]
63 include/start_group_replication.inc
64
65 # 2. Single Primary
66
67 # 2.1. Execute action to switch to single primary with server1 as
68 # primary
69 SELECT group_replication_switch_to_single_primary_mode("MEMBER1_UUID");
70 group_replication_switch_to_single_primary_mode("MEMBER1_UUID")
71 Mode switched to single-primary successfully.
72
73 # 2.2. Create table on Group Replication
74 CREATE TABLE t1 (a INT NOT NULL AUTO_INCREMENT PRIMARY KEY , b INT);
75
76 # 2.3. Begin a transaction on server1
77 BEGIN;
78 INSERT INTO test.t1 (b) VALUES (1);
79
80 # 2.4. Execute action to set as primary server2
81 [connection server_1]
82 SELECT group_replication_set_as_primary("MEMBER2_UUID");
83
84 # 2.5. Verify server is waiting for pending transactions to finish in
85 # order to conclude action
86 [connection server_1_1]
87
88 # 2.6. Stop server 2
89 [connection server2]
90 include/stop_group_replication.inc
91
92 # 2.7. Verify the action executed on server1 failed,
93 # the selected server exited from the group
94 [connection server_1]
95 ERROR HY000: The function 'group_replication_set_as_primary' failed. Primary assigned for election left the group, this operation will be aborted. No primary election was invoked under this operation.
96
97 # 2.8. Verify that server1 is the primary
98 include/gr_assert_primary_member.inc
99
100 # 2.9. Cleanup
101 [connection server1]
102 DROP TABLE t1;
103 [connection server2]
104 include/start_group_replication.inc
105 include/group_replication_end.inc