Debian Codegraph @

mysql-test/suite/group_replication/r/gr_primary_mode_group_operations_48.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 server1 and bootstrap group
8 include/start_and_bootstrap_group_replication.inc
9 CREATE TABLE test.t1 (a INT PRIMARY KEY);
10
11 # 2. Configure server2 with weight to be next primary
12 [connection server2]
13 SET GLOBAL group_replication_member_weight= 90;
14 include/start_group_replication.inc
15
16 # 3. Lock table to block primary election
17 LOCK TABLE t1 READ;
18
19 # 4. Start server3
20 [connection server3]
21 set session sql_log_bin=0;
22 call mtr.add_suppression("The function 'group_replication_switch_to_multi_primary_mode' failed. A primary election is occurring in the group. Wait for it to end.");
23 set session sql_log_bin=1;
24 include/start_group_replication.inc
25
26 # 5. Insert data to prevent server2 set read only and block on primary
27 # election
28 [connection server1]
29 INSERT INTO t1 VALUES (1);
30
31 # 6. Stop server1 and run primary election
32 include/stop_group_replication.inc
33
34 # 7. Executing an action will fail, a primary election is running
35 [connection server3]
36 SELECT group_replication_switch_to_multi_primary_mode();
37 ERROR HY000: The function 'group_replication_switch_to_multi_primary_mode' failed. A primary election is occurring in the group. Wait for it to end.
38
39 # 8. Unlock table to primary election finish
40 [connection server2]
41 UNLOCK TABLES;
42
43 # 9. Assert server2 is the new primary
44 include/gr_assert_primary_member.inc
45
46 # 10. Cleanup
47 [connection server1]
48 include/start_group_replication.inc
49 [connection server2]
50 DROP TABLE t1;
51 SET GLOBAL group_replication_member_weight= DEFAULT;
52 include/group_replication_end.inc