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