Debian Codegraph @

mysql-test/suite/group_replication/r/gr_primary_mode_group_operations_29.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. Members in Multi Primary Mode, create two tables and rpl_sync
8 CREATE TABLE test.t1 (a INT PRIMARY KEY);
9 CREATE TABLE test.t2 (a INT PRIMARY KEY);
10 include/rpl_sync.inc
11
12 # 2. On a member server2 that will be secondary lock a table t1
13 [connection server2]
14 LOCK TABLE t1 READ;
15
16 # 3. On other member insert value on table locked on server2
17 [connection server_3]
18 SET @@GLOBAL.group_replication_member_weight= 90;
19 INSERT INTO t1 VALUES (1);
20 [connection server_2]
21
22 # 4. Execute action to change to single primary with server1 as primary
23 [connection server3]
24 SELECT group_replication_switch_to_single_primary_mode("MEMBER1_UUID");
25 [connection server_3]
26
27 # 5. Check that the other members are waiting for members to be in read
28 # mode. Stages should be
29 # - Primary Election: waiting for members to enable super_read_only
30 # - Single-primary Switch: executing Primary election - completed work 0
31 include/assert.inc [The stage should be "Single-primary Switch: executing Primary election"]
32 include/assert.inc [The stage should be "Primary Election: waiting for members to enable super_read_only"]
33
34 # 6. Lock a table t2 on the primary server1
35 [connection server1]
36 LOCK TABLE t2 READ;
37
38 # 7. Insert something on t2 on server2, the locked secondary
39 [connection server_2_1]
40 INSERT INTO t2 VALUES (1);
41
42 # 8. Unlock table t1 on server2, the locked secondary
43 [connection server2]
44 UNLOCK TABLES;
45
46 # 9. Stage should be
47 # - Single-primary Switch: executing Primary election - completed work 1
48
49 # 10. Kill the new primary server1
50 [connection server1]
51 # 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
52 include/rpl_reconnect.inc
53
54 # 11. Check that the action finishes
55 [connection server2]
56 include/rpl_gr_wait_for_number_of_members.inc
57
58 # 12. Check server2 was able to insert value
59 [connection server_2_1]
60
61 # 13. Using weights one can assert here that primary is now server3
62 [connection server3]
63 group_replication_switch_to_single_primary_mode("MEMBER1_UUID")
64 Mode switched to single-primary with reported warnings: The appointed primary left the group as the operation is terminating. Check the group member list to see who is the primary.
65 Warnings:
66 Warning 3910 The appointed primary left the group as the operation is terminating. Check the group member list to see who is the primary. There were warnings detected also on other members, check their logs.
67 include/gr_assert_primary_member.inc
68
69 # 14. Cleanup
70 [connection server1]
71 include/start_group_replication.inc
72 [connection server3]
73 SET @@GLOBAL.group_replication_member_weight= DEFAULT;
74 DROP TABLE t1;
75 DROP TABLE t2;
76 include/group_replication_end.inc