1
by brian
clean slate |
1 |
#
|
2 |
# Testing replication delay reporting (bug#29309) |
|
3 |
# there is an unavoidable non-determinism in the test |
|
4 |
# please compare the results with the comments |
|
5 |
#
|
|
6 |
||
7 |
||
8 |
source include/master-slave.inc; |
|
9 |
||
10 |
connection master; |
|
11 |
#connection slave; |
|
12 |
sync_slave_with_master; |
|
13 |
--replace_result $DEFAULT_MASTER_PORT DEFAULT_MASTER_PORT |
|
14 |
--replace_column 1 # 8 # 9 # 23 # |
|
15 |
--query_vertical show slave status /* Second_behind reports 0 */; |
|
16 |
sleep 3; |
|
17 |
||
18 |
### bug emulation |
|
19 |
||
20 |
connection master; |
|
21 |
drop table if exists t1; |
|
22 |
create table t1 (f1 int); |
|
23 |
sleep 3; |
|
24 |
||
25 |
#connection slave; |
|
26 |
sync_slave_with_master; |
|
27 |
flush logs /* contaminate rli->last_master_timestamp */; |
|
28 |
||
29 |
connection slave; |
|
30 |
lock table t1 write; |
|
31 |
||
32 |
connection master; |
|
33 |
insert into t1 values (1); |
|
34 |
||
35 |
sleep 3; |
|
36 |
||
37 |
connection slave; |
|
38 |
--replace_result $DEFAULT_MASTER_PORT DEFAULT_MASTER_PORT |
|
39 |
--replace_column 1 # 8 # 9 # 23 # |
|
40 |
--query_vertical show slave status /* bug emulated: reports slave threads starting time about 3*3 not 3 secs */; |
|
41 |
unlock tables; |
|
42 |
||
43 |
connection master; |
|
44 |
sync_slave_with_master; |
|
45 |
||
46 |
### bugfix |
|
47 |
||
48 |
||
49 |
connection slave; |
|
50 |
flush logs /* this time rli->last_master_timestamp is not affected */; |
|
51 |
lock table t1 write; |
|
52 |
||
53 |
connection master; |
|
54 |
insert into t1 values (2); |
|
55 |
sleep 3; |
|
56 |
||
57 |
connection slave; |
|
58 |
--replace_result $DEFAULT_MASTER_PORT DEFAULT_MASTER_PORT |
|
59 |
--replace_column 1 # 8 # 9 # 23 # |
|
60 |
--query_vertical show slave status /* reports the correct diff with master query time about 3+3 secs */; |
|
61 |
unlock tables; |
|
62 |
||
63 |
connection master; |
|
64 |
drop table t1; |
|
65 |
||
66 |
#connection slave; |
|
67 |
sync_slave_with_master; |
|
68 |
||
69 |
||
70 |
# End of tests |
|
71 |