summaryrefslogtreecommitdiff
path: root/mysql-test/t/rpl_dual_pos_advance.test
blob: 518fa9df88592cc362539e0c2732f608c56fe9d7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# This test checks that in a dual-head setup
# A->B->A, where A has --log-slave-updates (why would it?
# assume that there is a C as slave of A),
# then the Exec_master_log_pos of SHOW SLAVE STATUS does
# not stay too low on B(BUG#13023 due to events ignored because
# of their server id).
# It also will test BUG#13861.

source include/master-slave.inc;


# set up "dual head"

connection slave;
reset master;

connection master;
--replace_result $SLAVE_MYPORT SLAVE_PORT
eval change master to master_host="127.0.0.1",master_port=$SLAVE_MYPORT,master_user="root";

start slave;

# now we test it

connection slave;

create table t1 (n int);

save_master_pos;
connection master;
sync_with_master;

# Now test BUG#13861. This will be enabled when Guilhem fixes this
# bug.

# stop slave

# create table t2 (n int); # create one ignored event

# save_master_pos;
# connection slave;
# sync_with_master;

# connection slave;

# show tables;

# save_master_pos;

# create table t3 (n int);

# connection master;

# bug is that START SLAVE UNTIL may stop too late, we test that by
# asking it to stop before creation of t3.

# start slave until master_log_file="slave-bin.000001",master_log_pos=195;

# wait until it's started (the position below is the start of "CREATE
# TABLE t2") (otherwise wait_for_slave_to_stop may return at once)

# select master_pos_wait("slave-bin.000001",137);

# wait_for_slave_to_stop;

# then BUG#13861 causes t3 to show up below (because stopped too
# late).

# show tables;

# start slave;

# BUG#13023 is that Exec_master_log_pos may stay too low "forever":

connection master;

create table t4 (n int); # create 3 ignored events
create table t5 (n int);
create table t6 (n int);

save_master_pos;
connection slave;
sync_with_master;

connection slave;

save_master_pos;

connection master;

# then BUG#13023 caused hang below ("master" looks behind, while it's
# not in terms of updates done).

sync_with_master;

show tables;

# cleanup

stop slave;
reset slave;
drop table t1,t4,t5,t6; # add t2 and t3 later

save_master_pos;
connection slave;
sync_with_master;

# End of 4.1 tests