Debian Codegraph @

mysql-test/suite/group_replication/r/gr_primary_mode_group_operations_26.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 @@GLOBAL.DEBUG= '+d,group_replication_block_group_action';
12 set session sql_log_bin=0;
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
16 # 1.2. On server2 execute action to change to single primary with
17 # server1 as primary
18 [connection server2]
19 set session sql_log_bin=0;
20 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.");
21 set session sql_log_bin=1;
22 SELECT group_replication_switch_to_single_primary_mode("MEMBER1_UUID");
23
24 # 1.3. Verify that server2 is checking group pre-conditions
25 [connection server_2]
26 include/assert.inc [stage/group_rpl/Single-primary Switch: checking group pre-conditions]
27
28 # 1.4. Kill and restart server1
29 [connection server_1]
30 # Kill and restart:--group_replication_local_address=GROUP_REPLICATION_LOCAL_ADDRESS --group_replication_group_seeds=GROUP_REPLICATION_GROUP_SEEDS --group_replication_group_name=GROUP_REPLICATION_GROUP_NAME
31 include/rpl_reconnect.inc
32
33 # 1.5. Reap action to switch to single primary and it returns error as
34 # server1 was killed
35 [connection server2]
36 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.
37
38 # 1.6. Add suppression on server3 for action failure
39 [connection server3]
40 set session sql_log_bin=0;
41 call mtr.add_suppression("Error while executing a group configuration operation: Primary assigned for election left the group, this operation will be aborted.");
42 set session sql_log_bin=1;
43
44 # 1.7. Confirm that group replication is on Multi primary server
45 include/gr_assert_multi_primary_mode.inc
46 [connection server2]
47 include/gr_assert_multi_primary_mode.inc
48
49 # 1.8. Cleanup to run Single Primary test
50 [connection server1]
51 include/start_group_replication.inc
52
53 # 2. Single Primary
54
55 # 2.1. Execute action to switch to single primary with server1 as
56 # primary
57 SELECT group_replication_switch_to_single_primary_mode("MEMBER1_UUID");
58 group_replication_switch_to_single_primary_mode("MEMBER1_UUID")
59 Mode switched to single-primary successfully.
60
61 # 2.2. Create table on Group Replication
62 CREATE TABLE t1 (a INT NOT NULL AUTO_INCREMENT PRIMARY KEY , b INT);
63
64 # 2.3. Begin a transaction on server1
65 BEGIN;
66 INSERT INTO test.t1 (b) VALUES (1);
67
68 # 2.4. Execute action to set as primary server2
69 [connection server_1_1]
70 SELECT group_replication_set_as_primary("MEMBER2_UUID");
71
72 # 2.5. Verify server is waiting for pending transactions to finish in
73 # order to conclude action
74 [connection server_1]
75 include/assert.inc [stage/group_rpl/Primary Switch: waiting for pending transactions to finish]
76 include/assert.inc [The estimated work is 1]
77 include/assert.inc [The completed work is 0]
78
79 # 2.6. Kill and restart server2, it would be the new primary
80 [connection server2]
81 # Kill and restart:--group_replication_local_address=GROUP_REPLICATION_LOCAL_ADDRESS --group_replication_group_seeds=GROUP_REPLICATION_GROUP_SEEDS --group_replication_group_name=GROUP_REPLICATION_GROUP_NAME
82 include/rpl_reconnect.inc
83
84 # 2.7. Verify the action executed on server1 failed, server selected
85 # exited from the group
86 [connection server_1_1]
87 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.
88
89 # 2.8. Assert server1 is the new primary
90 include/gr_assert_primary_member.inc
91
92 # 2.9. Cleanup
93 [connection server1]
94 COMMIT;
95 DROP TABLE t1;
96 [connection server2]
97 DROP TABLE t1;
98 include/group_replication_end.inc