2002-09-11 06:40:08 +03:00
|
|
|
# Testing if "flush logs" command bouncing resulting in logs created in a loop
|
|
|
|
# in case of bi-directional replication
|
2005-12-22 06:39:02 +01:00
|
|
|
-- source include/master-slave.inc
|
2002-09-11 06:40:08 +03:00
|
|
|
|
2007-12-12 18:19:24 +01:00
|
|
|
let $MYSQLD_DATADIR= `select @@datadir`;
|
|
|
|
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR/
|
2007-10-10 12:21:11 +05:00
|
|
|
show variables like 'relay_log%';
|
|
|
|
|
2002-09-11 06:40:08 +03:00
|
|
|
connection slave;
|
2005-12-22 06:39:02 +01:00
|
|
|
--disable_warnings
|
2005-07-15 17:51:43 +02:00
|
|
|
stop slave;
|
2005-12-22 06:39:02 +01:00
|
|
|
--enable_warnings
|
2002-09-23 16:34:49 +03:00
|
|
|
--replace_result $MASTER_MYPORT MASTER_PORT
|
2002-09-11 06:40:08 +03:00
|
|
|
eval change master to master_host='127.0.0.1',master_user='root',
|
|
|
|
master_password='',master_port=$MASTER_MYPORT;
|
2002-10-24 17:46:14 -06:00
|
|
|
start slave;
|
2006-03-21 17:40:51 +01:00
|
|
|
|
|
|
|
#
|
|
|
|
# Start replication slave -> master
|
|
|
|
#
|
2002-09-11 06:40:08 +03:00
|
|
|
connection master;
|
2005-12-22 06:39:02 +01:00
|
|
|
--disable_warnings
|
|
|
|
stop slave;
|
|
|
|
--enable_warnings
|
2002-09-23 16:34:49 +03:00
|
|
|
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
2002-09-11 06:40:08 +03:00
|
|
|
eval change master to master_host='127.0.0.1',master_user='root',
|
|
|
|
master_password='',master_port=$SLAVE_MYPORT;
|
2006-03-21 17:40:51 +01:00
|
|
|
|
2008-07-10 18:09:39 +02:00
|
|
|
source include/start_slave.inc;
|
2006-03-21 17:40:51 +01:00
|
|
|
|
|
|
|
#
|
|
|
|
# Flush logs of slave
|
|
|
|
#
|
2008-02-28 14:36:14 +03:00
|
|
|
# Create full loop by following way:
|
|
|
|
# 1. Insert into t1 on master (1st).
|
|
|
|
# 2. Insert into t1 on slave (2nd) when the event (1st) for t1 replicated.
|
|
|
|
# 3. Master waits until the event (2nd) for t1 will be replicated.
|
|
|
|
|
|
|
|
--disable_query_log
|
|
|
|
CREATE TABLE t1 (a INT KEY) ENGINE= MyISAM;
|
2008-03-02 20:17:39 +03:00
|
|
|
let $wait_binlog_event= CREATE TABLE t1;
|
|
|
|
--source include/wait_for_binlog_event.inc
|
2008-03-01 00:05:23 +03:00
|
|
|
sync_slave_with_master;
|
2008-03-28 18:25:49 +02:00
|
|
|
|
2008-03-01 00:05:23 +03:00
|
|
|
connection master;
|
2008-02-28 14:36:14 +03:00
|
|
|
INSERT INTO t1 VALUE(1);
|
|
|
|
--enable_query_log
|
|
|
|
FLUSH LOGS;
|
2008-03-28 18:25:49 +02:00
|
|
|
let $slave_param_value= query_get_value(SHOW MASTER STATUS, Position, 1);
|
|
|
|
|
2008-02-28 14:36:14 +03:00
|
|
|
connection slave;
|
2008-03-28 18:25:49 +02:00
|
|
|
let $slave_param= Exec_Master_Log_Pos;
|
|
|
|
source include/wait_for_slave_param.inc;
|
|
|
|
|
2008-02-28 14:36:14 +03:00
|
|
|
--disable_query_log
|
|
|
|
INSERT INTO t1 VALUE(2);
|
2008-03-28 18:25:49 +02:00
|
|
|
let $slave_param_value= query_get_value(SHOW MASTER STATUS, Position, 1);
|
2008-02-28 14:36:14 +03:00
|
|
|
--enable_query_log
|
2008-03-28 18:25:49 +02:00
|
|
|
|
2008-02-28 14:36:14 +03:00
|
|
|
connection master;
|
2008-03-28 18:25:49 +02:00
|
|
|
let $slave_param= Exec_Master_Log_Pos;
|
|
|
|
source include/wait_for_slave_param.inc;
|
|
|
|
|
2008-02-28 14:36:14 +03:00
|
|
|
--enable_query_log
|
2006-03-21 17:40:51 +01:00
|
|
|
|
|
|
|
#
|
|
|
|
# Show status of slave
|
|
|
|
#
|
2008-03-28 18:25:49 +02:00
|
|
|
--replace_result $SLAVE_MYPORT SLAVE_PORT $slave_param_value POSITION
|
2007-06-09 07:19:37 +02:00
|
|
|
--replace_column 1 # 8 # 9 # 16 # 23 # 33 # 34 # 35 #
|
|
|
|
--query_vertical SHOW SLAVE STATUS
|
2008-07-09 14:34:00 +02:00
|
|
|
|
|
|
|
--disable_query_log
|
|
|
|
connection master;
|
|
|
|
DROP TABLE t1;
|
|
|
|
sync_slave_with_master;
|
|
|
|
--enable_query_log
|