Debian Codegraph @

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

raw
1 include/group_replication.inc
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. Create a table on group
8 CREATE TABLE test.t1 (a INT PRIMARY KEY);
9 include/rpl_sync.inc
10 [connection server2]
11
12 # 2. Lock tables on server2, this will block the action after insert
13 # data on the group
14 LOCK TABLE t1 WRITE;
15 [connection server1]
16
17 # 3. Insert values and execute action
18 INSERT INTO t1 VALUES (1);
19 SELECT group_replication_switch_to_single_primary_mode("MEMBER1_UUID");
20
21 # 4. Confirm group is waiting for members to set read only
22 [connection server_1]
23
24 # 5. Confirm server1 that is executing action, can't change value of
25 # member weight
26 [connection server_1]
27 SET @@GLOBAL.group_replication_member_weight= 100;
28 ERROR 42000: The member weight for primary elections cannot be changed while group configuration operation 'Change to single primary mode' is running initiated by 'SELECT group_replication_switch_to_single_primary_mode()'.
29
30 # 6. Confirm server2 can't change value of member weight, an action is
31 # being executed on the group
32 [connection server2]
33 SET @@GLOBAL.group_replication_member_weight= 100;
34 ERROR 42000: The member weight for primary elections cannot be changed while group configuration operation 'Change to single primary mode' is running initiated by 'SELECT group_replication_switch_to_single_primary_mode()'.
35
36 # 7. Unlock the tables and to allow action proceed
37 UNLOCK TABLES;
38
39 # 8. Reap action that will complete successfully
40 [connection server1]
41 group_replication_switch_to_single_primary_mode("MEMBER1_UUID")
42 Mode switched to single-primary successfully.
43
44 # 9. Cleanup
45 DROP TABLE t1;
46 include/group_replication_end.inc