Debian Codegraph @

mysql-test/suite/group_replication/r/gr_primary_mode_group_operations_46.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. Test starts in Single primary mode with server1 as primary
8 include/start_and_bootstrap_group_replication.inc
9 CREATE TABLE t1(a int primary key);
10 [connection server2]
11
12 # 2. Set weight on server2 to be the next elected primary and join to
13 # the group
14 SET @@GLOBAL.group_replication_member_weight= 90;
15 include/start_group_replication.inc
16
17 # 3. Add server3 to group
18 [connection server3]
19 include/start_group_replication.inc
20
21 # 4. Lock table on the new primary (server 2)
22 [connection server_2]
23 LOCK TABLE t1 READ;
24
25 # 5. Execute a transaction that will stuck
26 [connection server1]
27 INSERT INTO t1 VALUES (1);
28
29 # 6. Stop server1
30 include/stop_group_replication.inc
31
32 # 7. Server2 will wait for buffered transactions on read only mode
33 [connection server2]
34
35 # 8. Unlock table on server2
36 [connection server_2]
37 UNLOCK TABLES;
38
39 # 9. Server2 will apply buffered transactions and disable read only mode
40
41 # 10. Assert server2 is primary server
42 include/gr_assert_primary_member.inc
43
44 # 11. Cleanup
45 [connection server1]
46 include/start_group_replication.inc
47 [connection server2]
48 SET @@GLOBAL.group_replication_member_weight= DEFAULT;
49 DROP TABLE t1;
50 include/group_replication_end.inc