| 1 |
################################################################################ |
| 2 |
# Validate that Group Replication channels are listed on all |
| 3 |
# replication P_S tables. |
| 4 |
# |
| 5 |
# Test: |
| 6 |
# 0. The test requires two servers: M1 and M2. |
| 7 |
# 1. Before start GR channels are not present on common replication P_S tables. |
| 8 |
# 2. After start GR on M2 channels are present on common replication P_S tables. |
| 9 |
# 3. Group Replication running channels sample output on common replication |
| 10 |
# P_S tables. Execute some transactions on M2 to make M1 |
| 11 |
# performance_schema.replication_connection_status.RECEIVED_TRANSACTION_SET |
| 12 |
# not empty. |
| 13 |
# 4. Clean up data. |
| 14 |
# 5. Stop GR on M2, channels must continue to be present on common replication |
| 15 |
# P_S tables. |
| 16 |
# 6. Group Replication stopped channels sample output on common replication |
| 17 |
# P_S tables. |
| 18 |
# 7. Group Replication channel must not be present on common replication P_S |
| 19 |
# tables after a RESET SLAVE ALL command. |
| 20 |
# 8. Test end. |
| 21 |
################################################################################ |
| 22 |
|
| 23 |
--let $group_replication_group_name= 8a94f357-aab4-11df-86ab-c80aa9429444 |
| 24 |
--source include/not_have_privilege_checks_user.inc |
| 25 |
--source include/have_group_replication_plugin.inc |
| 26 |
--let $rpl_skip_group_replication_start= 1 |
| 27 |
--source include/group_replication.inc |
| 28 |
|
| 29 |
|
| 30 |
--echo |
| 31 |
--echo ############################################################ |
| 32 |
--echo # 1. Before start Group Replication channels are not present |
| 33 |
--echo # on common replication P_S tables. |
| 34 |
--connection server1 |
| 35 |
--let $assert_text= 'There is no Group Replication applier channel on performance_schema.replication_connection_configuration table' |
| 36 |
--let $assert_cond= COUNT(*) = 0 FROM performance_schema.replication_connection_configuration WHERE channel_name = "group_replication_applier" |
| 37 |
--source include/assert.inc |
| 38 |
|
| 39 |
--let $assert_text= 'There is no Group Replication applier channel on performance_schema.replication_connection_status table' |
| 40 |
--let $assert_cond= COUNT(*) = 0 FROM performance_schema.replication_connection_status WHERE channel_name = "group_replication_applier" |
| 41 |
--source include/assert.inc |
| 42 |
|
| 43 |
--let $assert_text= 'There is no Group Replication applier channel on performance_schema.replication_applier_configuration table' |
| 44 |
--let $assert_cond= COUNT(*) = 0 FROM performance_schema.replication_applier_configuration WHERE channel_name = "group_replication_applier" |
| 45 |
--source include/assert.inc |
| 46 |
|
| 47 |
--let $assert_text= 'There is no Group Replication applier channel on performance_schema.replication_applier_status table' |
| 48 |
--let $assert_cond= COUNT(*) = 0 FROM performance_schema.replication_applier_status WHERE channel_name = "group_replication_applier" |
| 49 |
--source include/assert.inc |
| 50 |
|
| 51 |
--let $assert_text= 'There is no Group Replication applier channel on performance_schema.replication_applier_status_by_coordinator table' |
| 52 |
--let $assert_cond= COUNT(*) = 0 FROM performance_schema.replication_applier_status_by_coordinator WHERE channel_name = "group_replication_applier" |
| 53 |
--source include/assert.inc |
| 54 |
|
| 55 |
--let $assert_text= 'There is no Group Replication applier channel on performance_schema.replication_applier_status_by_worker table' |
| 56 |
--let $assert_cond= COUNT(*) = 0 FROM performance_schema.replication_applier_status_by_worker WHERE channel_name = "group_replication_applier" |
| 57 |
--source include/assert.inc |
| 58 |
|
| 59 |
|
| 60 |
--echo |
| 61 |
--echo ############################################################ |
| 62 |
--echo # 2. After start Group Replication channels are present |
| 63 |
--echo # on common replication P_S tables. |
| 64 |
--connection server2 |
| 65 |
--source include/start_and_bootstrap_group_replication.inc |
| 66 |
--connection server1 |
| 67 |
--source include/start_group_replication.inc |
| 68 |
|
| 69 |
--let $assert_text= 'There is a Group Replication applier channel on performance_schema.replication_connection_configuration table' |
| 70 |
--let $assert_cond= COUNT(*) = 1 FROM performance_schema.replication_connection_configuration WHERE channel_name = "group_replication_applier" |
| 71 |
--source include/assert.inc |
| 72 |
|
| 73 |
--let $assert_text= 'There is a Group Replication applier channel on performance_schema.replication_connection_status table' |
| 74 |
--let $assert_cond= COUNT(*) = 1 FROM performance_schema.replication_connection_status WHERE channel_name = "group_replication_applier" |
| 75 |
--source include/assert.inc |
| 76 |
|
| 77 |
--let $assert_text= 'There is a Group Replication applier channel on performance_schema.replication_applier_configuration table' |
| 78 |
--let $assert_cond= COUNT(*) = 1 FROM performance_schema.replication_applier_configuration WHERE channel_name = "group_replication_applier" |
| 79 |
--source include/assert.inc |
| 80 |
|
| 81 |
--let $assert_text= 'There is a Group Replication applier channel on performance_schema.replication_applier_status table' |
| 82 |
--let $assert_cond= COUNT(*) = 1 FROM performance_schema.replication_applier_status WHERE channel_name = "group_replication_applier" |
| 83 |
--source include/assert.inc |
| 84 |
|
| 85 |
# Even if worker number is set to 0, since GR channels use GTID_ONLY there is always at least one worker active |
| 86 |
--let $assert_text= 'There is no Group Replication applier channel on performance_schema.replication_applier_status_by_coordinator table' |
| 87 |
--let $assert_cond= COUNT(*) = 1 FROM performance_schema.replication_applier_status_by_coordinator WHERE channel_name = "group_replication_applier" |
| 88 |
--source include/assert.inc |
| 89 |
|
| 90 |
--let $assert_text= 'There is a Group Replication applier channel on performance_schema.replication_applier_status_by_worker table' |
| 91 |
--let $assert_cond= COUNT(*) = 1 FROM performance_schema.replication_applier_status_by_worker WHERE channel_name = "group_replication_applier" |
| 92 |
--source include/assert.inc |
| 93 |
|
| 94 |
|
| 95 |
--echo |
| 96 |
--echo ############################################################ |
| 97 |
--echo # 3. Group Replication running channels sample output |
| 98 |
--echo # on common replication P_S tables. |
| 99 |
--connection server2 |
| 100 |
# Execute some transactions on server2 to make server1 |
| 101 |
# performance_schema.replication_connection_status.RECEIVED_TRANSACTION_SET |
| 102 |
# not empty. |
| 103 |
CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY) ENGINE=InnoDB; |
| 104 |
INSERT INTO t1 VALUES (1); |
| 105 |
--source include/rpl_sync.inc |
| 106 |
|
| 107 |
--connection server1 |
| 108 |
|
| 109 |
# Wait that performance schema update LAST_APPLIED_TRANSACTION to |
| 110 |
# APPLYING_TRANSACTION* columns be 0 |
| 111 |
--let $wait_condition= SELECT COUNT(*) = 1 FROM performance_schema.replication_applier_status_by_worker WHERE channel_name="group_replication_applier" AND LAST_APPLIED_TRANSACTION="$group_replication_group_name:4" |
| 112 |
--source include/wait_condition.inc |
| 113 |
|
| 114 |
--echo #group_replication_recovery channel configuration |
| 115 |
--let $group_replication_ca= `SELECT @@group_replication_recovery_ssl_ca` |
| 116 |
--let $group_replication_cert= `SELECT @@group_replication_recovery_ssl_cert` |
| 117 |
--let $group_replication_ssl_key= `SELECT @@group_replication_recovery_ssl_key` |
| 118 |
--replace_result $group_replication_ssl_key KEY $group_replication_cert CERT $group_replication_ca CA |
| 119 |
--query_vertical SELECT * FROM performance_schema.replication_connection_configuration WHERE channel_name LIKE "group_replication_recovery" |
| 120 |
|
| 121 |
--echo #group_replication_applier channel configuration |
| 122 |
--query_vertical SELECT * FROM performance_schema.replication_connection_configuration WHERE channel_name LIKE "group_replication_applier" |
| 123 |
|
| 124 |
--echo |
| 125 |
--replace_column 13 [ORIGINAL_COMMIT_TIMESTAMP] 14 [IMMEDIATE_COMMIT_TIMESTAMP] 15 [START_QUEUE_TIMESTAMP] 16 [END_QUEUE_TIMESTAMP] |
| 126 |
--query_vertical SELECT * FROM performance_schema.replication_connection_status WHERE channel_name = "group_replication_applier" |
| 127 |
|
| 128 |
--echo |
| 129 |
--query_vertical SELECT * FROM performance_schema.replication_applier_configuration WHERE channel_name = "group_replication_applier" |
| 130 |
|
| 131 |
--echo |
| 132 |
--query_vertical SELECT * FROM performance_schema.replication_applier_status WHERE channel_name = "group_replication_applier" |
| 133 |
|
| 134 |
--echo |
| 135 |
--replace_column 2 [THREAD_ID] 7 [LAST_PROCESSED_TRANSACTION] 8 [ORIGINAL_COMMIT_TIMESTAMP] 9 [IMMEDIATE_COMMIT_TIMESTAMP] 10 [START_BUFFER_TIMESTAMP] 11 [END_BUFFER_TIMESTAMP] |
| 136 |
--query_vertical SELECT * FROM performance_schema.replication_applier_status_by_coordinator WHERE channel_name = "group_replication_applier" |
| 137 |
|
| 138 |
--echo |
| 139 |
--replace_column 3 [THREAD_ID] 9 [ORIGINAL_COMMIT_TIMESTAMP] 10 [IMMEDIATE_COMMIT_TIMESTAMP] 11 [START_APPLY_TIMESTAMP] 12 [END_APPLY_TIMESTAMP] |
| 140 |
--query_vertical SELECT * FROM performance_schema.replication_applier_status_by_worker WHERE channel_name = "group_replication_applier" |
| 141 |
|
| 142 |
|
| 143 |
--echo |
| 144 |
--echo ############################################################ |
| 145 |
--echo # 4. Clean up data. |
| 146 |
--connection server2 |
| 147 |
DROP TABLE t1; |
| 148 |
--source include/rpl_sync.inc |
| 149 |
|
| 150 |
|
| 151 |
--echo |
| 152 |
--echo ############################################################ |
| 153 |
--echo # 5. Stop Group Replication, channels must continue to be |
| 154 |
--echo # present on common replication P_S tables. |
| 155 |
--connection server2 |
| 156 |
--source include/stop_group_replication.inc |
| 157 |
--connection server1 |
| 158 |
--source include/stop_group_replication.inc |
| 159 |
|
| 160 |
--let $assert_text= 'There is still a Group Replication applier channel on performance_schema.replication_connection_configuration table' |
| 161 |
--let $assert_cond= COUNT(*) = 1 FROM performance_schema.replication_connection_configuration WHERE channel_name = "group_replication_applier" |
| 162 |
--source include/assert.inc |
| 163 |
|
| 164 |
--let $assert_text= 'There is still a Group Replication applier channel on performance_schema.replication_connection_status table' |
| 165 |
--let $assert_cond= COUNT(*) = 1 FROM performance_schema.replication_connection_status WHERE channel_name = "group_replication_applier" |
| 166 |
--source include/assert.inc |
| 167 |
|
| 168 |
--let $assert_text= 'There is still a Group Replication applier channel on performance_schema.replication_applier_configuration table' |
| 169 |
--let $assert_cond= COUNT(*) = 1 FROM performance_schema.replication_applier_configuration WHERE channel_name = "group_replication_applier" |
| 170 |
--source include/assert.inc |
| 171 |
|
| 172 |
--let $assert_text= 'There is still a Group Replication applier channel on performance_schema.replication_applier_status table' |
| 173 |
--let $assert_cond= COUNT(*) = 1 FROM performance_schema.replication_applier_status WHERE channel_name = "group_replication_applier" |
| 174 |
--source include/assert.inc |
| 175 |
|
| 176 |
--let $assert_text= 'There is still no Group Replication applier channel on performance_schema.replication_applier_status_by_coordinator table' |
| 177 |
--let $assert_cond= COUNT(*) = 1 FROM performance_schema.replication_applier_status_by_coordinator WHERE channel_name = "group_replication_applier" |
| 178 |
--source include/assert.inc |
| 179 |
|
| 180 |
--let $assert_text= 'There is still a Group Replication applier channel on performance_schema.replication_applier_status_by_worker table' |
| 181 |
--let $assert_cond= COUNT(*) = 1 FROM performance_schema.replication_applier_status_by_worker WHERE channel_name = "group_replication_applier" |
| 182 |
--source include/assert.inc |
| 183 |
|
| 184 |
|
| 185 |
--echo |
| 186 |
--echo ############################################################ |
| 187 |
--echo # 6. Group Replication stopped channels sample output |
| 188 |
--echo # on common replication P_S tables. |
| 189 |
|
| 190 |
--echo #group_replication_recovery channel configuration |
| 191 |
--let $group_replication_ca= `SELECT @@group_replication_recovery_ssl_ca` |
| 192 |
--let $group_replication_cert= `SELECT @@group_replication_recovery_ssl_cert` |
| 193 |
--let $group_replication_ssl_key= `SELECT @@group_replication_recovery_ssl_key` |
| 194 |
--replace_result $group_replication_ssl_key KEY $group_replication_cert CERT $group_replication_ca CA |
| 195 |
--query_vertical SELECT * FROM performance_schema.replication_connection_configuration WHERE channel_name LIKE "group_replication_recovery" |
| 196 |
|
| 197 |
--echo #group_replication_applier channel configuration |
| 198 |
--query_vertical SELECT * FROM performance_schema.replication_connection_configuration WHERE channel_name LIKE "group_replication_applier" |
| 199 |
|
| 200 |
--echo |
| 201 |
--replace_column 13 [ORIGINAL_COMMIT_TIMESTAMP] 14 [IMMEDIATE_COMMIT_TIMESTAMP] 15 [START_QUEUE_TIMESTAMP] 16 [END_QUEUE_TIMESTAMP] |
| 202 |
--query_vertical SELECT * FROM performance_schema.replication_connection_status WHERE channel_name = "group_replication_applier" |
| 203 |
|
| 204 |
--echo |
| 205 |
--query_vertical SELECT * FROM performance_schema.replication_applier_configuration WHERE channel_name = "group_replication_applier" |
| 206 |
|
| 207 |
--echo |
| 208 |
--query_vertical SELECT * FROM performance_schema.replication_applier_status WHERE channel_name = "group_replication_applier" |
| 209 |
|
| 210 |
--echo |
| 211 |
--replace_column 2 [THREAD_ID] 7 [LAST_PROCESSED_TRANSACTION] 8 [ORIGINAL_COMMIT_TIMESTAMP] 9 [IMMEDIATE_COMMIT_TIMESTAMP] 10 [START_BUFFER_TIMESTAMP] 11 [END_BUFFER_TIMESTAMP] |
| 212 |
--query_vertical SELECT * FROM performance_schema.replication_applier_status_by_coordinator WHERE channel_name = "group_replication_applier" |
| 213 |
|
| 214 |
--echo |
| 215 |
--replace_column 9 [ORIGINAL_COMMIT_TIMESTAMP] 10 [IMMEDIATE_COMMIT_TIMESTAMP] 11 [START_APPLY_TIMESTAMP] 12 [END_APPLY_TIMESTAMP] |
| 216 |
--query_vertical SELECT * FROM performance_schema.replication_applier_status_by_worker WHERE channel_name = "group_replication_applier" |
| 217 |
|
| 218 |
|
| 219 |
--echo |
| 220 |
--echo ############################################################ |
| 221 |
--echo # 7. Group Replication channel must not be present on common |
| 222 |
--echo # replication P_S tables after a RESET ALL command. |
| 223 |
RESET SLAVE ALL FOR CHANNEL "group_replication_applier"; |
| 224 |
|
| 225 |
--let $assert_text= 'There is no Group Replication applier channel on performance_schema.replication_connection_configuration table' |
| 226 |
--let $assert_cond= COUNT(*) = 0 FROM performance_schema.replication_connection_configuration WHERE channel_name = "group_replication_applier" |
| 227 |
--source include/assert.inc |
| 228 |
|
| 229 |
--let $assert_text= 'There is no Group Replication applier channel on performance_schema.replication_connection_status table' |
| 230 |
--let $assert_cond= COUNT(*) = 0 FROM performance_schema.replication_connection_status WHERE channel_name = "group_replication_applier" |
| 231 |
--source include/assert.inc |
| 232 |
|
| 233 |
--let $assert_text= 'There is no Group Replication applier channel on performance_schema.replication_applier_configuration table' |
| 234 |
--let $assert_cond= COUNT(*) = 0 FROM performance_schema.replication_applier_configuration WHERE channel_name = "group_replication_applier" |
| 235 |
--source include/assert.inc |
| 236 |
|
| 237 |
--let $assert_text= 'There is no Group Replication applier channel on performance_schema.replication_applier_status table' |
| 238 |
--let $assert_cond= COUNT(*) = 0 FROM performance_schema.replication_applier_status WHERE channel_name = "group_replication_applier" |
| 239 |
--source include/assert.inc |
| 240 |
|
| 241 |
--let $assert_text= 'There is no Group Replication applier channel on performance_schema.replication_applier_status_by_coordinator table' |
| 242 |
--let $assert_cond= COUNT(*) = 0 FROM performance_schema.replication_applier_status_by_coordinator WHERE channel_name = "group_replication_applier" |
| 243 |
--source include/assert.inc |
| 244 |
|
| 245 |
--let $assert_text= 'There is no Group Replication applier channel on performance_schema.replication_applier_status_by_worker table' |
| 246 |
--let $assert_cond= COUNT(*) = 0 FROM performance_schema.replication_applier_status_by_worker WHERE channel_name = "group_replication_applier" |
| 247 |
--source include/assert.inc |
| 248 |
|
| 249 |
|
| 250 |
--echo |
| 251 |
--echo ############################################################ |
| 252 |
--echo # 8. Test end. |
| 253 |
--source include/group_replication_end.inc |