Debian Codegraph @

mysql-test/suite/group_replication/r/gr_primary_mode_group_operations_30.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 a group in single primary mode.
8 include/start_and_bootstrap_group_replication.inc
9 CREATE TABLE test.t1 (a INT PRIMARY KEY);
10 [connection server2]
11 include/start_group_replication.inc
12
13 # 2. Go to a member that will be a secondary and lock a table
14 [connection server3]
15 include/start_group_replication.inc
16 SET @@GLOBAL.read_only= 0;
17 LOCK TABLE t1 READ;
18
19 # 3. Insert a row on primary
20 [connection server1]
21 INSERT INTO t1 VALUES (1);
22
23 # 4. Invoke a change the primary to server2
24 [connection server2]
25 SELECT group_replication_set_as_primary("MEMBER2_UUID");
26
27 # 5. Check that the other members are waiting for members to be in read
28 # mode.
29 # Stages should be
30 # - Primary Election: waiting for members to enable super_read_only
31 # - Primary Switch: executing Primary election
32 [connection server_2]
33 include/assert.inc [stage/group_rpl/Primary Switch: executing Primary election]
34 include/assert.inc [stage/group_rpl/Primary Election: waiting for members to enable super_read_only]
35
36 # 6. Kill the stuck secondary
37 [connection server3]
38 # 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 --group_replication_communication_stack=GROUP_REPLICATION_COMMUNICATION_STACK
39 include/rpl_reconnect.inc
40
41 # 7. Check that the action finishes
42 [connection server2]
43 group_replication_set_as_primary("MEMBER2_UUID")
44 Primary server switched to: MEMBER2_UUID
45
46 # 8. Check that primary is now server2
47 include/gr_assert_primary_member.inc
48 [connection server1]
49 include/gr_assert_secondary_member.inc
50
51 # 9. Cleanup
52 [connection server2]
53 DROP TABLE t1;
54 [connection server3]
55 DROP TABLE t1;
56 include/group_replication_end.inc