| 1 |
######################################################## |
| 2 |
# By JBM 2005-02-15 Wrapped to allow reuse of test code# |
| 3 |
######################################################## |
| 4 |
-- source include/have_binlog_format_row.inc |
| 5 |
-- source include/master-slave.inc |
| 6 |
|
| 7 |
# Test if the slave SQL thread can be more than 16K behind the slave |
| 8 |
# I/O thread (> IO_SIZE) |
| 9 |
|
| 10 |
# we'll use table-level locking to delay slave SQL thread |
| 11 |
eval CREATE TABLE t1 (n INT); |
| 12 |
sync_slave_with_master; |
| 13 |
connection master; |
| 14 |
RESET MASTER; |
| 15 |
connection slave; |
| 16 |
STOP SLAVE; |
| 17 |
--source include/reset_slave.inc |
| 18 |
|
| 19 |
connection master; |
| 20 |
let $1=5000; |
| 21 |
# Generate 16K of relay log |
| 22 |
disable_query_log; |
| 23 |
while ($1) |
| 24 |
{ |
| 25 |
eval INSERT INTO t1 VALUES($1); |
| 26 |
dec $1; |
| 27 |
} |
| 28 |
enable_query_log; |
| 29 |
SELECT COUNT(*) FROM t1; |
| 30 |
save_master_pos; |
| 31 |
|
| 32 |
# Try to cause a large relay log lag on the slave by locking t1 |
| 33 |
connection slave; |
| 34 |
LOCK TABLES t1 READ; |
| 35 |
START SLAVE; |
| 36 |
UNLOCK TABLES; |
| 37 |
sync_with_master; |
| 38 |
SELECT COUNT(*) FROM t1; |
| 39 |
|
| 40 |
connection master; |
| 41 |
DROP TABLE t1; |
| 42 |
CREATE TABLE t1 (n INT); |
| 43 |
INSERT INTO t1 VALUES(3456); |
| 44 |
sync_slave_with_master; |
| 45 |
SELECT n FROM t1; |
| 46 |
|
| 47 |
connection master; |
| 48 |
DROP TABLE t1; |
| 49 |
|
| 50 |
sync_slave_with_master; |
| 51 |
--source include/rpl_end.inc |