Debian Codegraph @

mysql-test/suite/group_replication/r/gr_notifications_mode_change.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. Start server M1 and M2 with gms_listener service implementation.
8 # Set M2 member weight to 90. M2 becomes primary during mode change.
9 # Delete all notifications on M1 and M2.
10
11 # Adding debug point 'register_gms_listener_example' to @@GLOBAL.debug
12 SET SQL_LOG_BIN=0;
13 CREATE TABLE test.gms_listener_example(log_message TEXT);
14 SET SQL_LOG_BIN=1;
15 include/start_and_bootstrap_group_replication.inc
16 [connection server2]
17 SET @member_weight2_save= @@GLOBAL.group_replication_member_weight;
18 SET GLOBAL group_replication_member_weight= 90;
19 # Adding debug point 'register_gms_listener_example' to @@GLOBAL.debug
20 SET SQL_LOG_BIN=0;
21 CREATE TABLE test.gms_listener_example(log_message TEXT);
22 SET SQL_LOG_BIN=1;
23 include/start_group_replication.inc
24 include/assert.inc [Assert that there are 2 notifications logged of type STATE %:2]
25 include/assert.inc [Assert that there are 1 notifications logged of type VIEW %:%]
26 include/assert.inc [Assert that there are 3 notifications logged]
27 [Truncating gms_listener_example Table]
28 [connection server1]
29 include/assert.inc [Assert that there are 2 notifications logged of type STATE %:2]
30 include/assert.inc [Assert that there are 2 notifications logged of type STATE %:1]
31 include/assert.inc [Assert that there are 2 notifications logged of type VIEW %:%]
32 include/assert.inc [Assert that there are 6 notifications logged]
33 [Truncating gms_listener_example Table]
34
35 # 2. Change mode to SPM. M2 becomes primary due to weight.
36 # Assert ROLE notification is broadcasted.
37
38 SELECT group_replication_switch_to_single_primary_mode();
39 group_replication_switch_to_single_primary_mode()
40 Mode switched to single-primary successfully.
41 include/gr_assert_secondary_member.inc
42 include/assert.inc [Assert that there are 1 notifications logged of type ROLE %:%]
43 include/assert.inc [Assert that there are 1 notifications logged]
44 [Truncating gms_listener_example Table]
45 [connection server2]
46 include/gr_assert_primary_member.inc
47 include/assert.inc [Assert that there are 1 notifications logged of type ROLE %:%]
48 include/assert.inc [Assert that there are 1 notifications logged]
49 [Truncating gms_listener_example Table]
50
51 # 3. Change mode to MPM.
52 # Assert ROLE notification is broadcasted.
53
54 [connection server1]
55 SELECT group_replication_switch_to_multi_primary_mode();
56 group_replication_switch_to_multi_primary_mode()
57 Mode switched to multi-primary successfully.
58 include/gr_assert_multi_primary_mode.inc
59 include/assert.inc [Assert that there are 1 notifications logged of type ROLE %:%]
60 include/assert.inc [Assert that there are 1 notifications logged]
61 [Truncating gms_listener_example Table]
62 [connection server2]
63 include/gr_assert_multi_primary_mode.inc
64 include/assert.inc [Assert that there are 1 notifications logged of type ROLE %:%]
65 include/assert.inc [Assert that there are 1 notifications logged]
66 [Truncating gms_listener_example Table]
67
68 # 4. Change mode to SPM specifying server1 as primary.
69 # Assert ROLE notification is broadcasted.
70
71 [connection server1]
72 SELECT group_replication_switch_to_single_primary_mode("MEMBER1_UUID");;
73 group_replication_switch_to_single_primary_mode("MEMBER1_UUID")
74 Mode switched to single-primary successfully.
75 include/gr_assert_primary_member.inc
76 include/assert.inc [Assert that there are 1 notifications logged of type ROLE %:%]
77 include/assert.inc [Assert that there are 1 notifications logged]
78 [Truncating gms_listener_example Table]
79 [connection server2]
80 include/gr_assert_secondary_member.inc
81 include/assert.inc [Assert that there are 1 notifications logged of type ROLE %:%]
82 include/assert.inc [Assert that there are 1 notifications logged]
83 [Truncating gms_listener_example Table]
84
85 # 5. Switch primary.
86 # Assert ROLE notification is broadcasted.
87
88 [connection server1]
89 SELECT group_replication_set_as_primary("MEMBER2_UUID");
90 group_replication_set_as_primary("MEMBER2_UUID")
91 Primary server switched to: MEMBER2_UUID
92 include/gr_assert_secondary_member.inc
93 include/assert.inc [Assert that there are 1 notifications logged of type ROLE %:%]
94 include/assert.inc [Assert that there are 1 notifications logged]
95 [Truncating gms_listener_example Table]
96 [connection server2]
97 include/gr_assert_primary_member.inc
98 include/assert.inc [Assert that there are 1 notifications logged of type ROLE %:%]
99 include/assert.inc [Assert that there are 1 notifications logged]
100 [Truncating gms_listener_example Table]
101
102 # 6. Cleanup.
103
104 SELECT group_replication_switch_to_multi_primary_mode();
105 group_replication_switch_to_multi_primary_mode()
106 Mode switched to multi-primary successfully.
107 SET SQL_LOG_BIN=0;
108 DROP TABLE test.gms_listener_example;
109 SET SQL_LOG_BIN=1;
110 SET @@GLOBAL.group_replication_member_weight= @member_weight2_save;
111 include/stop_group_replication.inc
112 # Removing debug point 'register_gms_listener_example' from @@GLOBAL.debug
113 [connection server1]
114 SET SQL_LOG_BIN=0;
115 DROP TABLE test.gms_listener_example;
116 SET SQL_LOG_BIN=1;
117 include/stop_group_replication.inc
118 # Removing debug point 'register_gms_listener_example' from @@GLOBAL.debug
119 include/group_replication_end.inc