mirror of
https://github.com/MariaDB/server.git
synced 2025-09-11 05:52:26 +03:00
5.2 merge
This commit is contained in:
@@ -12,5 +12,3 @@
|
||||
|
||||
rpl_row_create_table : Bug#11759274 Feb 27 2010 andrei failed different way than earlier with bug#45576
|
||||
rpl_get_master_version_and_clock : Bug#11766137 Jan 05 2011 joro Valgrind warnings rpl_get_master_version_and_clock
|
||||
rpl_stm_until : BUG#59543 Jan 26 2011 alfranio Replication test from eits suite rpl_row_until times out
|
||||
rpl_row_until @macosx : BUG#15965353 RPL.RPL_ROW_UNTIL FAILS ON PB2 , PLATFORM= MACOSX10.6 X86_64 MAX
|
||||
|
@@ -20,6 +20,18 @@
|
||||
--source include/rpl_init.inc
|
||||
--echo
|
||||
|
||||
#set auto inc variables at each server
|
||||
--let $_rpl_server= $rpl_server_count
|
||||
while ($_rpl_server)
|
||||
{
|
||||
--let $rpl_connection_name= server_$_rpl_server
|
||||
--source include/rpl_connection.inc
|
||||
eval SET auto_increment_increment= $rpl_server_count;
|
||||
eval SET auto_increment_offset= $_rpl_server;
|
||||
|
||||
--dec $_rpl_server
|
||||
}
|
||||
|
||||
# Preparing data.
|
||||
--echo *** Preparing data ***
|
||||
--connection server_1
|
||||
|
28
mysql-test/suite/rpl/t/rpl_dump_events_twice_bug.test
Normal file
28
mysql-test/suite/rpl/t/rpl_dump_events_twice_bug.test
Normal file
@@ -0,0 +1,28 @@
|
||||
#
|
||||
# Verify dump thread can send events in active file, correctly after
|
||||
# encountering an IO error.
|
||||
#
|
||||
--source include/have_debug.inc
|
||||
--source include/master-slave.inc
|
||||
|
||||
CALL mtr.add_suppression("Failed to read an event from active binlog.*");
|
||||
SET @debug_saved= @@GLOBAL.DEBUG;
|
||||
|
||||
CREATE TABLE t1(c1 INT);
|
||||
INSERT INTO t1 VALUES(1);
|
||||
|
||||
--sync_slave_with_master
|
||||
|
||||
--source include/rpl_connection_master.inc
|
||||
SET GLOBAL debug='+d,dump_fake_io_error';
|
||||
INSERT INTO t1 VALUES(2);
|
||||
INSERT INTO t1 VALUES(3);
|
||||
|
||||
--sync_slave_with_master
|
||||
--let $diff_tables= master:t1, slave:t1
|
||||
--source include/diff_tables.inc
|
||||
|
||||
--source include/rpl_connection_master.inc
|
||||
SET @@GLOBAL.DEBUG= @debug_saved;
|
||||
DROP TABLE t1;
|
||||
--source include/rpl_end.inc
|
@@ -46,7 +46,7 @@ SELECT COUNT(*) FROM mysqltest.t1;
|
||||
# Cleanup
|
||||
connection master;
|
||||
DROP DATABASE mysqltest;
|
||||
DROP TABLE test.t1;
|
||||
DROP TABLE IF EXISTS test.t1;
|
||||
sync_slave_with_master;
|
||||
|
||||
# End of test
|
||||
|
@@ -20,7 +20,7 @@ create table if not exists t1 (n int);
|
||||
drop table t1;
|
||||
|
||||
call mtr.add_suppression ("Slave I/O: Got fatal error 1236 from master when reading data from binary");
|
||||
call mtr.add_suppression ("Error in Log_event::read_log_event");
|
||||
CALL mtr.add_suppression("Failed to read an event from active binlog.*");
|
||||
source include/show_master_status.inc;
|
||||
sync_slave_with_master;
|
||||
source include/stop_slave.inc;
|
||||
|
51
mysql-test/suite/rpl/t/rpl_lost_events_on_rotate.test
Normal file
51
mysql-test/suite/rpl/t/rpl_lost_events_on_rotate.test
Normal file
@@ -0,0 +1,51 @@
|
||||
#
|
||||
# Whenever the mysql_binlog_send method (dump thread) reaches the
|
||||
# end of file when reading events from the binlog, before checking
|
||||
# if it should wait for more events, there was a test to check if
|
||||
# the file being read was still active, i.e, it was the last known
|
||||
# binlog. However, it was possible that something was written to
|
||||
# the binary log and then a rotation would happen, after EOF was
|
||||
# detected and before the check for active was performed. In this
|
||||
# case, the end of the binary log would not be read by the dump
|
||||
# thread, and this would cause the slave to lose updates.
|
||||
#
|
||||
# This test verifies that the problem has been fixed. It waits
|
||||
# during this window while forcing a rotation in the binlog.
|
||||
#
|
||||
--source include/have_debug.inc
|
||||
--source include/master-slave.inc
|
||||
|
||||
--connection master
|
||||
|
||||
SET @debug_saved= @@GLOBAL.DEBUG;
|
||||
|
||||
CREATE TABLE t (i INT);
|
||||
|
||||
# When reaching the EOF the dump thread will wait before deciding if
|
||||
# it should move to a new binlong file.
|
||||
SET GLOBAL DEBUG= "d,wait_after_binlog_EOF";
|
||||
|
||||
INSERT INTO t VALUES (1);
|
||||
|
||||
--sleep 1
|
||||
|
||||
# A insert and a rotate happens before the decision
|
||||
INSERT INTO t VALUES (2);
|
||||
FLUSH LOGS;
|
||||
|
||||
SET DEBUG_SYNC= 'now SIGNAL signal.rotate_finished';
|
||||
|
||||
--sync_slave_with_master
|
||||
|
||||
# All the rows should be sent to the slave.
|
||||
--let $diff_tables=master:t,slave:t
|
||||
--source include/diff_tables.inc
|
||||
|
||||
##Clean up
|
||||
--connection master
|
||||
|
||||
SET @@GLOBAL.DEBUG= @debug_saved;
|
||||
SET DEBUG_SYNC= 'RESET';
|
||||
|
||||
DROP TABLE t;
|
||||
--source include/rpl_end.inc
|
@@ -2,7 +2,13 @@
|
||||
-- source include/have_binlog_format_row.inc
|
||||
-- source include/master-slave.inc
|
||||
|
||||
# Note: The test is dependent on binlog positions
|
||||
##############################################################################
|
||||
# The test is dependent on binlog positions. The test is divided into two
|
||||
# sections. The first section checks START SLAVE UNTIL MASTER_LOG_FILE =
|
||||
# 'log_name', MASTER_LOG_POS = log_pos followed by a couple of failure
|
||||
# scenarios. The second section checks START SLAVE UNTIL RELAY_LOG_FILE =
|
||||
# 'log_name', RELAY_LOG_POS = log_pos.
|
||||
##############################################################################
|
||||
|
||||
# Create some events on master
|
||||
connection master;
|
||||
@@ -22,14 +28,8 @@ let $master_pos_create_t2= query_get_value(SHOW BINLOG EVENTS, Pos, 8);
|
||||
INSERT INTO t2 VALUES (1),(2);
|
||||
save_master_pos;
|
||||
# Save master log position for query INSERT INTO t2 VALUES (1),(2);
|
||||
let $master_pos_insert1_t2= query_get_value(SHOW BINLOG EVENTS, End_log_pos, 12);
|
||||
sync_slave_with_master;
|
||||
let $master_pos_insert1_t2= query_get_value(SHOW MASTER STATUS, Position, 1);
|
||||
|
||||
# Save relay log position for query INSERT INTO t2 VALUES (1),(2);
|
||||
let $relay_log_file= query_get_value(show slave status, Relay_Log_File,1);
|
||||
let $relay_pos_insert1_t2= query_get_value(show slave status, Relay_Log_Pos, 1);
|
||||
|
||||
connection master;
|
||||
INSERT INTO t2 VALUES (3),(4);
|
||||
DROP TABLE t2;
|
||||
# Save master log position for query INSERT INTO t2 VALUES (1),(2);
|
||||
@@ -68,17 +68,6 @@ SELECT * FROM t1;
|
||||
--let $slave_param_value= $master_pos_drop_t1
|
||||
--source include/check_slave_param.inc
|
||||
|
||||
# Try replicate all up to and not including the second insert to t2;
|
||||
--disable_query_log
|
||||
eval START SLAVE UNTIL RELAY_LOG_FILE='$relay_log_file', RELAY_LOG_POS=$relay_pos_insert1_t2;
|
||||
--enable_query_log
|
||||
--source include/wait_for_slave_sql_to_stop.inc
|
||||
SELECT * FROM t2;
|
||||
|
||||
--let $slave_param= Exec_Master_Log_Pos
|
||||
--let $slave_param_value= $master_pos_insert1_t2
|
||||
--source include/check_slave_param.inc
|
||||
|
||||
# clean up
|
||||
START SLAVE;
|
||||
--source include/wait_for_slave_to_start.inc
|
||||
@@ -119,9 +108,49 @@ START SLAVE;
|
||||
--replace_result 740 MASTER_LOG_POS
|
||||
START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=740;
|
||||
|
||||
--source include/stop_slave.inc
|
||||
# Clear slave IO error.
|
||||
RESET SLAVE;
|
||||
--source include/start_slave.inc
|
||||
|
||||
--let $rpl_only_running_threads= 1
|
||||
##############################################################################
|
||||
# The second section - checks START SLAVE UNTIL RELAY_LOG_FILE =# 'log_name',
|
||||
# RELAY_LOG_POS = log_pos. This section of the test does the following:
|
||||
# 1) At master, create a table and inserts a value. Let slave replicate this.
|
||||
# 2) Stop slave sql thread.
|
||||
# 3) Insert some more values at master. Note that io thread copies this insert
|
||||
# 4) Use start slave until to start the sql thread and check if it
|
||||
# stops at the correct position.
|
||||
##############################################################################
|
||||
|
||||
--source include/rpl_reset.inc
|
||||
|
||||
--connection master
|
||||
CREATE TABLE t1 (a INT);
|
||||
INSERT INTO t1 VALUES (1);
|
||||
|
||||
--sync_slave_with_master
|
||||
--source include/stop_slave_sql.inc
|
||||
|
||||
--connection master
|
||||
INSERT INTO t1 VALUES (2);
|
||||
--let $master_log_pos= query_get_value(SHOW MASTER STATUS, Position, 1)
|
||||
INSERT INTO t1 VALUES (3);
|
||||
|
||||
--source include/sync_slave_io_with_master.inc
|
||||
|
||||
--let $relay_log_file= query_get_value(SHOW SLAVE STATUS, Relay_Log_File,1)
|
||||
--source include/get_relay_log_pos.inc
|
||||
|
||||
--disable_query_log
|
||||
--eval start slave until relay_log_file='$relay_log_file', relay_log_pos=$relay_log_pos
|
||||
--enable_query_log
|
||||
--source include/wait_for_slave_sql_to_stop.inc
|
||||
|
||||
--let $assert_cond= COUNT(*) = 2 FROM t1
|
||||
--let $assert_text= table t1 should have two rows.
|
||||
--source include/assert.inc
|
||||
|
||||
#cleanup
|
||||
--source include/start_slave.inc
|
||||
--connection master
|
||||
DROP TABLE t1;
|
||||
--sync_slave_with_master
|
||||
--source include/rpl_end.inc
|
||||
|
@@ -184,44 +184,6 @@ connection slave;
|
||||
start slave;
|
||||
sync_with_master;
|
||||
|
||||
# Bug #47142 "slave start until" stops 1 event too late in 4.1 to 5.0 replication
|
||||
#
|
||||
# testing fixes that refine the start position of prior-5.0 master's event
|
||||
# and by that provide correct execution of
|
||||
# START SLAVE UNTIL ... master_log_pos= x;
|
||||
# Keep the test at the end of the file because it manipulates with binlog files
|
||||
# to substitute the genuine one with a prepared on 4.1 server.
|
||||
#
|
||||
|
||||
--source include/rpl_reset.inc
|
||||
|
||||
connection master;
|
||||
--disable_warnings
|
||||
drop table if exists t1; # there is create table t1 in bug47142_master-bin.000001
|
||||
--enable_warnings
|
||||
sync_slave_with_master;
|
||||
connection slave;
|
||||
stop slave;
|
||||
connection master;
|
||||
|
||||
flush logs;
|
||||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
--remove_file $MYSQLD_DATADIR/master-bin.000001
|
||||
--copy_file $MYSQL_TEST_DIR/std_data/bug47142_master-bin.000001 $MYSQLD_DATADIR/master-bin.000001
|
||||
flush logs;
|
||||
|
||||
connection slave;
|
||||
reset slave;
|
||||
start slave until master_log_file='master-bin.000001', master_log_pos=294 /* to stop right before DROP */;
|
||||
--source include/wait_for_slave_sql_to_stop.inc
|
||||
|
||||
show tables /* t1 must exist */;
|
||||
|
||||
# clean-up of Bug #47142 testing
|
||||
|
||||
drop table t1; # drop on slave only, master does not have t1.
|
||||
stop slave;
|
||||
|
||||
# End of tests
|
||||
--let $rpl_only_running_threads= 1
|
||||
--source include/rpl_end.inc
|
||||
|
Reference in New Issue
Block a user