~vlad-lesin/percona-server/mysql-5.0.33-original

« back to all changes in this revision

Viewing changes to mysql-test/t/rpl_dual_pos_advance.test

  • Committer: Vlad Lesin
  • Date: 2012-07-31 09:21:34 UTC
  • Revision ID: vladislav.lesin@percona.com-20120731092134-zfodx022b7992wsi
VirginĀ 5.0.33

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# This test checks that in a dual-head setup
 
2
# A->B->A, where A has --log-slave-updates (why would it?
 
3
# assume that there is a C as slave of A),
 
4
# then the Exec_master_log_pos of SHOW SLAVE STATUS does
 
5
# not stay too low on B(BUG#13023 due to events ignored because
 
6
# of their server id).
 
7
# It also will test BUG#13861.
 
8
 
 
9
source include/master-slave.inc;
 
10
 
 
11
 
 
12
# set up "dual head"
 
13
 
 
14
connection slave;
 
15
reset master;
 
16
 
 
17
connection master;
 
18
--replace_result $SLAVE_MYPORT SLAVE_PORT
 
19
eval change master to master_host="127.0.0.1",master_port=$SLAVE_MYPORT,master_user="root";
 
20
 
 
21
start slave;
 
22
 
 
23
# now we test it
 
24
 
 
25
connection slave;
 
26
 
 
27
create table t1 (n int);
 
28
 
 
29
save_master_pos;
 
30
connection master;
 
31
sync_with_master;
 
32
 
 
33
# Now test BUG#13861. This will be enabled when Guilhem fixes this
 
34
# bug.
 
35
 
 
36
# stop slave
 
37
 
 
38
# create table t2 (n int); # create one ignored event
 
39
 
 
40
# save_master_pos;
 
41
# connection slave;
 
42
# sync_with_master;
 
43
 
 
44
# connection slave;
 
45
 
 
46
# show tables;
 
47
 
 
48
# save_master_pos;
 
49
 
 
50
# create table t3 (n int);
 
51
 
 
52
# connection master;
 
53
 
 
54
# bug is that START SLAVE UNTIL may stop too late, we test that by
 
55
# asking it to stop before creation of t3.
 
56
 
 
57
# start slave until master_log_file="slave-bin.000001",master_log_pos=195;
 
58
 
 
59
# wait until it's started (the position below is the start of "CREATE
 
60
# TABLE t2") (otherwise wait_for_slave_to_stop may return at once)
 
61
 
 
62
# select master_pos_wait("slave-bin.000001",137);
 
63
 
 
64
# wait_for_slave_to_stop;
 
65
 
 
66
# then BUG#13861 causes t3 to show up below (because stopped too
 
67
# late).
 
68
 
 
69
# show tables;
 
70
 
 
71
# start slave;
 
72
 
 
73
# BUG#13023 is that Exec_master_log_pos may stay too low "forever":
 
74
 
 
75
connection master;
 
76
 
 
77
create table t4 (n int); # create 3 ignored events
 
78
create table t5 (n int);
 
79
create table t6 (n int);
 
80
 
 
81
save_master_pos;
 
82
connection slave;
 
83
sync_with_master;
 
84
 
 
85
connection slave;
 
86
 
 
87
save_master_pos;
 
88
 
 
89
connection master;
 
90
 
 
91
# then BUG#13023 caused hang below ("master" looks behind, while it's
 
92
# not in terms of updates done).
 
93
 
 
94
sync_with_master;
 
95
 
 
96
show tables;
 
97
 
 
98
# cleanup
 
99
 
 
100
stop slave;
 
101
reset slave;
 
102
drop table t1,t4,t5,t6; # add t2 and t3 later
 
103
 
 
104
save_master_pos;
 
105
connection slave;
 
106
sync_with_master;
 
107
 
 
108
# End of 4.1 tests