Debian Codegraph @

mysql-test/suite/group_replication/r/gr_primary_mode_group_operations_28_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. Start single primary group and create table
8 include/start_and_bootstrap_group_replication.inc
9 CREATE TABLE test.t1 (a INT PRIMARY KEY);
10 include/rpl_sync.inc
11 [connection server2]
12 include/start_group_replication.inc
13
14 # 2. Disable read only to action be stuck on setting read only
15 [connection server3]
16 set session sql_log_bin=0;
17 call mtr.add_suppression("The function 'group_replication_set_as_primary' failed. The appointed primary for election left the group, this operation will be aborted*");
18 set session sql_log_bin=1;
19 include/start_group_replication.inc
20 SET GLOBAL read_only= 0;
21
22 # 3. Go to a member that will be a secondary and lock a table
23 [connection server_3]
24 LOCK TABLE t1 READ;
25
26 # 4. Insert a row on the old primary
27 [connection server1]
28 INSERT INTO t1 VALUES (1);
29 [connection server2]
30
31 # 5. Execute action to change primary to server2
32 [connection server3]
33 SELECT group_replication_set_as_primary("MEMBER2_UUID");
34
35 # 6. Check that the other members are waiting for members to be in
36 # super_read_only and executing primary election
37 [connection server_2]
38 include/assert.inc [stage/group_rpl/Primary Election: waiting for members to enable super_read_only]
39
40 # 7. Stop the new primary server2
41 [connection server2]
42 include/stop_group_replication.inc
43
44 # 8. Wait group detect exit of server2
45 [connection server_1]
46 include/rpl_gr_wait_for_number_of_members.inc
47
48 # 9. Unlock table on server3
49 [connection server_3]
50 UNLOCK TABLES;
51
52 # 10. Reap insertion of data on server1
53 [connection server1]
54
55 # 11. Check that the action returns failure
56 [connection server3]
57 ERROR HY000: The function 'group_replication_set_as_primary' failed. The appointed primary for election left the group, this operation will be aborted and if present the old primary member will be re-elected. Check the group member list to see who is the primary.
58
59 # 12. Confirm server1 is the new primary because it was the old primary
60 [connection server1]
61 include/gr_assert_primary_member.inc
62 set session sql_log_bin=0;
63 call mtr.add_suppression("Error while executing a group configuration operation: The appointed primary for election left the group, this operation will be aborted.*");
64 set session sql_log_bin=1;
65
66 # 13. Clean up
67 DROP TABLE t1;
68 [connection server2]
69 set session sql_log_bin=0;
70 call mtr.add_suppression("Error while executing a group configuration operation: This operation was locally aborted and for that reason terminated.");
71 set session sql_log_bin=1;
72 include/start_group_replication.inc
73 include/group_replication_end.inc