Debian Codegraph @

mysql-test/suite/group_replication/r/gr_primary_mode_group_operations_28.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 [connection server3]
14 set session sql_log_bin=0;
15 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*");
16 set session sql_log_bin=1;
17 include/start_group_replication.inc
18
19 # 2. Disable read only to action be stuck on setting read only
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_1]
38 include/assert.inc [stage/group_rpl/Primary Election: waiting for members to enable super_read_only]
39
40 # 7. Kill the new primary server2
41 [connection server2]
42 # Kill and restart:--group-replication-start-on-boot=0 --group-replication-group-name=GROUP_REPLICATION_GROUP_NAME --group_replication_local_address=GROUP_REPLICATION_LOCAL_ADDRESS --group_replication_group_seeds=GROUP_REPLICATION_GROUP_SEEDS --group_replication_single_primary_mode=TRUE --group_replication_enforce_update_everywhere_checks=FALSE
43 include/rpl_reconnect.inc
44
45 # 8. Wait group detect exit of server2
46 [connection server_1]
47 include/rpl_gr_wait_for_number_of_members.inc
48
49 # 9. Unlock table on server2
50 [connection server_3]
51 UNLOCK TABLES;
52
53 # 10. Reap insertion of data on server1
54 [connection server1]
55
56 # 11. Check that the action returns failure
57 [connection server3]
58 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.
59
60 # 12. Confirm server1 is the new primary because it was the old primary
61 [connection server1]
62 include/gr_wait_primary_member_uuid.inc
63
64 # 13. Clean up
65 DROP TABLE t1;
66 [connection server2]
67 DROP TABLE t1;
68 [connection server1]
69 set session sql_log_bin=0;
70 call mtr.add_suppression("Error while executing a group configuration operation: The appointed primary for election left the group, this operation will be aborted.*");
71 set session sql_log_bin=1;
72 include/group_replication_end.inc