| 1 |
# ==== Purpose ==== |
| 2 |
# |
| 3 |
# This test checks that channels can be created while load is put on the replica |
| 4 |
# |
| 5 |
# ==== Implementation ==== |
| 6 |
# |
| 7 |
# 0. The test needs 2 servers, one with load, and a replica where channels are created |
| 8 |
# 1. Create a table on the source and use Slap to apply load on the server |
| 9 |
# 2. Create 20 channels, 1 per second in the replica |
| 10 |
# 3. Check the data was replicated and 20 channel were created |
| 11 |
# 4. Cleanup |
| 12 |
# |
| 13 |
# ==== References ==== |
| 14 |
# |
| 15 |
# Bug#33090128 RANDOM ERROR 1201: COULD NOT INITIALIZE MASTER INFO STRUCTURE; ON CHANGE MASTER |
| 16 |
# |
| 17 |
|
| 18 |
--source include/not_valgrind.inc |
| 19 |
--source include/have_nodebug.inc |
| 20 |
--source include/big_test.inc |
| 21 |
--source include/have_binlog_format_row.inc |
| 22 |
--source include/have_slave_repository_type_table.inc |
| 23 |
--source include/master-slave.inc |
| 24 |
|
| 25 |
--echo # |
| 26 |
--echo # 1. Create a table on the source and use Slap to apply load on the server |
| 27 |
|
| 28 |
--source include/rpl_connection_master.inc |
| 29 |
|
| 30 |
CREATE TABLE test.t1 (a INT NOT NULL AUTO_INCREMENT PRIMARY KEY , b INT); |
| 31 |
|
| 32 |
--exec_in_background $MYSQL_SLAP --create-schema=test --delimiter=";" --iterations=1000 --query="INSERT INTO test.t1 (b) VALUES (1)" --concurrency=10 --silent 2>&1 |
| 33 |
|
| 34 |
--echo # |
| 35 |
--echo # 2. Create 20 channels, 1 per second in the replica |
| 36 |
|
| 37 |
--source include/rpl_connection_slave.inc |
| 38 |
|
| 39 |
--let $limit=20 |
| 40 |
|
| 41 |
--disable_result_log |
| 42 |
--let $iteration=1 |
| 43 |
while ( $iteration <= $limit ) |
| 44 |
{ |
| 45 |
--eval CHANGE REPLICATION SOURCE TO SOURCE_HOST = 'h', SOURCE_PORT = 1 FOR CHANNEL 'channel_$iteration' ; |
| 46 |
--inc $iteration |
| 47 |
--sleep 1 |
| 48 |
} |
| 49 |
--enable_result_log |
| 50 |
|
| 51 |
--echo # |
| 52 |
--echo # 3. Check the data was replicated and 20 channel were created |
| 53 |
|
| 54 |
--let $wait_timeout= 200 |
| 55 |
--let $wait_condition= SELECT COUNT(*)=10000 FROM test.t1 |
| 56 |
--source include/wait_condition.inc |
| 57 |
|
| 58 |
# 21 channels: 20 created + default channel |
| 59 |
--let $assert_text= 'There are 21 channels in the replica' |
| 60 |
--let $assert_cond= [SELECT COUNT(*) AS count FROM performance_schema.replication_connection_configuration, count, 1] = 21 |
| 61 |
--source include/assert.inc |
| 62 |
|
| 63 |
--echo # |
| 64 |
--echo # 4. Cleanup |
| 65 |
|
| 66 |
--let $iteration=1 |
| 67 |
while ( $iteration <= $limit ) |
| 68 |
{ |
| 69 |
--eval RESET REPLICA ALL FOR CHANNEL 'channel_$iteration' ; |
| 70 |
--inc $iteration |
| 71 |
} |
| 72 |
|
| 73 |
--source include/rpl_connection_master.inc |
| 74 |
|
| 75 |
DROP TABLE test.t1; |
| 76 |
|
| 77 |
--source include/rpl_end.inc |