1
by brian
clean slate |
1 |
# Testing if "flush logs" command bouncing resulting in logs created in a loop
|
2 |
# in case of bi-directional replication
|
|
3 |
-- source include/master-slave.inc |
|
4 |
||
5 |
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR |
|
6 |
show variables like 'relay_log%'; |
|
7 |
||
8 |
connection slave; |
|
9 |
--disable_warnings |
|
10 |
stop slave; |
|
11 |
--enable_warnings |
|
12 |
--replace_result $MASTER_MYPORT MASTER_PORT |
|
13 |
eval change master to master_host='127.0.0.1',master_user='root', |
|
14 |
master_password='',master_port=$MASTER_MYPORT; |
|
15 |
start slave; |
|
16 |
||
17 |
#
|
|
18 |
# Start replication slave -> master
|
|
19 |
#
|
|
20 |
connection master; |
|
21 |
--disable_warnings |
|
22 |
stop slave; |
|
23 |
--enable_warnings |
|
24 |
--replace_result $SLAVE_MYPORT SLAVE_PORT |
|
25 |
eval change master to master_host='127.0.0.1',master_user='root', |
|
26 |
master_password='',master_port=$SLAVE_MYPORT; |
|
27 |
start slave; |
|
28 |
||
29 |
#
|
|
30 |
# Wait for start of slave IO and SQL threads
|
|
31 |
#
|
|
32 |
let $result_pattern= '%127.0.0.1%root%slave-bin.000001%slave-bin.000001%Yes%Yes%0%0%None%'; |
|
33 |
--source include/wait_slave_status.inc |
|
34 |
||
35 |
#
|
|
36 |
# Flush logs of slave
|
|
37 |
#
|
|
38 |
# Create full loop by following way:
|
|
39 |
# 1. Insert into t1 on master (1st).
|
|
40 |
# 2. Insert into t1 on slave (2nd) when the event (1st) for t1 replicated.
|
|
41 |
# 3. Master waits until the event (2nd) for t1 will be replicated.
|
|
42 |
||
43 |
--disable_query_log |
|
44 |
CREATE TABLE t1 (a INT KEY) ENGINE= MyISAM; |
|
45 |
let $wait_binlog_event= CREATE TABLE t1; |
|
46 |
--source include/wait_for_binlog_event.inc |
|
47 |
sync_slave_with_master; |
|
48 |
||
49 |
connection master; |
|
50 |
INSERT INTO t1 VALUE(1); |
|
51 |
--enable_query_log |
|
52 |
FLUSH LOGS; |
|
53 |
let $slave_param_value= query_get_value(SHOW MASTER STATUS, Position, 1); |
|
54 |
||
55 |
connection slave; |
|
56 |
let $slave_param= Exec_Master_Log_Pos; |
|
57 |
source include/wait_for_slave_param.inc; |
|
58 |
||
59 |
--disable_query_log |
|
60 |
INSERT INTO t1 VALUE(2); |
|
61 |
let $slave_param_value= query_get_value(SHOW MASTER STATUS, Position, 1); |
|
62 |
--enable_query_log |
|
63 |
||
64 |
connection master; |
|
65 |
let $slave_param= Exec_Master_Log_Pos; |
|
66 |
source include/wait_for_slave_param.inc; |
|
67 |
||
68 |
--enable_query_log |
|
69 |
||
70 |
#
|
|
71 |
# Show status of slave
|
|
72 |
#
|
|
73 |
--replace_result $SLAVE_MYPORT SLAVE_PORT $slave_param_value POSITION |
|
74 |
--replace_column 1 # 8 # 9 # 16 # 23 # 33 # 34 # 35 # |
|
75 |
--query_vertical SHOW SLAVE STATUS |