mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
fixing tests results: rpl_ndb_log, rpl_ndb_multi, sp_trans_log; adding replicate-ignore_server_ids specific tests
This commit is contained in:
@ -14,15 +14,5 @@ end|
|
|||||||
reset master|
|
reset master|
|
||||||
insert into t2 values (bug23333(),1)|
|
insert into t2 values (bug23333(),1)|
|
||||||
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
|
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
|
||||||
show binlog events from <binlog_start>|
|
|
||||||
Log_name Pos Event_type Server_id End_log_pos Info
|
|
||||||
master-bin.000001 # Query # # use `test`; BEGIN
|
|
||||||
master-bin.000001 # Table_map # # table_id: # (test.t2)
|
|
||||||
master-bin.000001 # Table_map # # table_id: # (test.t1)
|
|
||||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
|
||||||
master-bin.000001 # Query # # use `test`; ROLLBACK
|
|
||||||
select count(*),@a from t1 /* must be 1,1 */|
|
|
||||||
count(*) @a
|
|
||||||
1 1
|
|
||||||
drop table t1,t2;
|
drop table t1,t2;
|
||||||
drop function if exists bug23333;
|
drop function if exists bug23333;
|
||||||
|
46
mysql-test/suite/rpl/r/rpl_server_id_ignore.result
Normal file
46
mysql-test/suite/rpl/r/rpl_server_id_ignore.result
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
stop slave;
|
||||||
|
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||||
|
reset master;
|
||||||
|
reset slave;
|
||||||
|
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||||
|
start slave;
|
||||||
|
master_id: 1
|
||||||
|
stop slave;
|
||||||
|
*** --replicate-same-server-id and change master option can clash ***
|
||||||
|
change master to IGNORE_SERVER_IDS= (2, 1);
|
||||||
|
ERROR HY000: The requested server id 2 clashes with the slave startup option --replicate-same-server-id
|
||||||
|
*** must be empty due to the error ***
|
||||||
|
ignore server id list:
|
||||||
|
change master to IGNORE_SERVER_IDS= (10, 100);
|
||||||
|
*** must be 10, 100 ***
|
||||||
|
ignore server id list: 10, 100
|
||||||
|
reset slave;
|
||||||
|
*** must be empty due to reset slave ***
|
||||||
|
ignore server id list: 10, 100
|
||||||
|
change master to IGNORE_SERVER_IDS= (10, 100);
|
||||||
|
*** CHANGE MASTER with IGNORE_SERVER_IDS option overrides (does not increment) the previous setup ***
|
||||||
|
change master to IGNORE_SERVER_IDS= (5, 1, 4, 3, 1);
|
||||||
|
*** must be 1, 3, 4, 5 due to overriding policy ***
|
||||||
|
ignore server id list: 1, 3, 4, 5
|
||||||
|
*** ignore master (server 1) queries for a while ***
|
||||||
|
start slave;
|
||||||
|
create table t1 (n int);
|
||||||
|
*** must be empty as the event is to be filtered out ***
|
||||||
|
show tables;
|
||||||
|
Tables_in_test
|
||||||
|
*** allowing events from master ***
|
||||||
|
stop slave;
|
||||||
|
reset slave;
|
||||||
|
change master to IGNORE_SERVER_IDS= (10, 100);
|
||||||
|
*** the list must remain (10, 100) after reset slave ***
|
||||||
|
change master to IGNORE_SERVER_IDS= ();
|
||||||
|
*** must be empty due to IGNORE_SERVER_IDS empty list ***
|
||||||
|
ignore server id list:
|
||||||
|
change master to master_host='127.0.0.1', master_port=MASTER_PORT, master_user='root';
|
||||||
|
start slave;
|
||||||
|
*** must have caught create table ***
|
||||||
|
show tables;
|
||||||
|
Tables_in_test
|
||||||
|
t1
|
||||||
|
drop table t1;
|
||||||
|
end of the tests
|
1
mysql-test/suite/rpl/t/rpl_server_id_ignore-slave.opt
Normal file
1
mysql-test/suite/rpl/t/rpl_server_id_ignore-slave.opt
Normal file
@ -0,0 +1 @@
|
|||||||
|
--disable-log-slave-updates --replicate-same-server-id
|
114
mysql-test/suite/rpl/t/rpl_server_id_ignore.test
Normal file
114
mysql-test/suite/rpl/t/rpl_server_id_ignore.test
Normal file
@ -0,0 +1,114 @@
|
|||||||
|
# This test checks that the slave rejects events originating
|
||||||
|
# by a server from the list of ignored originators (bug#27808 etc)
|
||||||
|
#
|
||||||
|
# phases of tests:
|
||||||
|
#
|
||||||
|
# 0. master_id new line in show slave status
|
||||||
|
# 1. syntax related:
|
||||||
|
# a. error reporting if options clash;
|
||||||
|
# b. overriding the old IGNORE_SERVER_IDS setup by the following
|
||||||
|
# CHANGE MASTER ... IGNORE_SERVER_IDS= (list);
|
||||||
|
# c. the old setup preserving by CHANGE MASTER w/o IGNORE_SERVER_IDS
|
||||||
|
# d. resetting the ignored server ids with the empty list arg to
|
||||||
|
# IGNORE_SERVER_IDS=()
|
||||||
|
# e. RESET SLAVE preserves the list
|
||||||
|
# 2. run time related:
|
||||||
|
# a. observing no processing events from a master listed in IGNORE_SERVER_IDS
|
||||||
|
# b. nullifying the list and resuming of taking binlog from the very beginning with
|
||||||
|
# executing events this time
|
||||||
|
|
||||||
|
source include/master-slave.inc;
|
||||||
|
|
||||||
|
connection slave;
|
||||||
|
|
||||||
|
# a new line for master_id
|
||||||
|
let $master_id= query_get_value(SHOW SLAVE STATUS, Master_Server_Id, 1);
|
||||||
|
echo master_id: $master_id;
|
||||||
|
|
||||||
|
stop slave;
|
||||||
|
--echo *** --replicate-same-server-id and change master option can clash ***
|
||||||
|
--error ER_SLAVE_IGNORE_SERVER_IDS
|
||||||
|
change master to IGNORE_SERVER_IDS= (2, 1);
|
||||||
|
--echo *** must be empty due to the error ***
|
||||||
|
let $ignore_list= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Server_Ids, 1);
|
||||||
|
echo ignore server id list: $ignore_list;
|
||||||
|
|
||||||
|
change master to IGNORE_SERVER_IDS= (10, 100);
|
||||||
|
--echo *** must be 10, 100 ***
|
||||||
|
let $ignore_list= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Server_Ids, 1);
|
||||||
|
echo ignore server id list: $ignore_list;
|
||||||
|
reset slave;
|
||||||
|
--echo *** must be empty due to reset slave ***
|
||||||
|
let $ignore_list= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Server_Ids, 1);
|
||||||
|
echo ignore server id list: $ignore_list;
|
||||||
|
change master to IGNORE_SERVER_IDS= (10, 100);
|
||||||
|
--echo *** CHANGE MASTER with IGNORE_SERVER_IDS option overrides (does not increment) the previous setup ***
|
||||||
|
change master to IGNORE_SERVER_IDS= (5, 1, 4, 3, 1);
|
||||||
|
--echo *** must be 1, 3, 4, 5 due to overriding policy ***
|
||||||
|
let $ignore_list= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Server_Ids, 1);
|
||||||
|
echo ignore server id list: $ignore_list;
|
||||||
|
--echo *** ignore master (server 1) queries for a while ***
|
||||||
|
start slave;
|
||||||
|
|
||||||
|
connection master;
|
||||||
|
|
||||||
|
#connection slave;
|
||||||
|
sync_slave_with_master;
|
||||||
|
let $slave_relay_pos0= query_get_value(SHOW SLAVE STATUS, Relay_Log_Pos, 1);
|
||||||
|
|
||||||
|
connection master;
|
||||||
|
create table t1 (n int);
|
||||||
|
let $master_binlog_end= query_get_value(SHOW MASTER STATUS, Position, 1);
|
||||||
|
|
||||||
|
connection slave;
|
||||||
|
let $slave_param= Exec_Master_Log_Pos;
|
||||||
|
let $slave_param_value= $master_binlog_end;
|
||||||
|
source include/wait_for_slave_param.inc;
|
||||||
|
--echo *** must be empty as the event is to be filtered out ***
|
||||||
|
show tables;
|
||||||
|
--echo *** allowing events from master ***
|
||||||
|
let $slave_relay_pos1= query_get_value(SHOW SLAVE STATUS, Relay_Log_Pos, 1);
|
||||||
|
#
|
||||||
|
# checking stability of relay log pos
|
||||||
|
#
|
||||||
|
if (`select $slave_relay_pos1 - $slave_relay_pos0`)
|
||||||
|
{
|
||||||
|
--echo Error: relay log position changed: $slave_relay_pos0, $slave_relay_pos1
|
||||||
|
query_vertical show slave status;
|
||||||
|
}
|
||||||
|
|
||||||
|
stop slave;
|
||||||
|
source include/wait_for_slave_to_stop.inc;
|
||||||
|
reset slave;
|
||||||
|
change master to IGNORE_SERVER_IDS= (10, 100);
|
||||||
|
--echo *** the list must remain (10, 100) after reset slave ***
|
||||||
|
let $ignore_list= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Server_Ids, 1);
|
||||||
|
|
||||||
|
change master to IGNORE_SERVER_IDS= ();
|
||||||
|
--echo *** must be empty due to IGNORE_SERVER_IDS empty list ***
|
||||||
|
let $ignore_list= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Server_Ids, 1);
|
||||||
|
echo ignore server id list: $ignore_list;
|
||||||
|
--replace_result $MASTER_MYPORT MASTER_PORT
|
||||||
|
eval change master to master_host='127.0.0.1', master_port=$MASTER_MYPORT, master_user='root';
|
||||||
|
start slave;
|
||||||
|
|
||||||
|
connection master;
|
||||||
|
|
||||||
|
#connection slave;
|
||||||
|
sync_slave_with_master;
|
||||||
|
--echo *** must have caught create table ***
|
||||||
|
show tables;
|
||||||
|
|
||||||
|
# cleanup
|
||||||
|
connection master;
|
||||||
|
drop table t1;
|
||||||
|
#connection slave
|
||||||
|
sync_slave_with_master;
|
||||||
|
|
||||||
|
--echo end of the tests
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -299,6 +299,8 @@ Last_IO_Errno #
|
|||||||
Last_IO_Error #
|
Last_IO_Error #
|
||||||
Last_SQL_Errno 0
|
Last_SQL_Errno 0
|
||||||
Last_SQL_Error
|
Last_SQL_Error
|
||||||
|
Replicate_Ignore_Server_Ids
|
||||||
|
Master_Server_Id 1
|
||||||
show binlog events in 'slave-bin.000005' from 4;
|
show binlog events in 'slave-bin.000005' from 4;
|
||||||
ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log
|
ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
@ -26,11 +26,11 @@ stop slave;
|
|||||||
SELECT @the_pos:=Position,@the_file:=SUBSTRING_INDEX(FILE, '/', -1)
|
SELECT @the_pos:=Position,@the_file:=SUBSTRING_INDEX(FILE, '/', -1)
|
||||||
FROM mysql.ndb_binlog_index WHERE epoch = <the_epoch> ;
|
FROM mysql.ndb_binlog_index WHERE epoch = <the_epoch> ;
|
||||||
@the_pos:=Position @the_file:=SUBSTRING_INDEX(FILE, '/', -1)
|
@the_pos:=Position @the_file:=SUBSTRING_INDEX(FILE, '/', -1)
|
||||||
106 master-bin.000001
|
107 master-bin.000001
|
||||||
CHANGE MASTER TO
|
CHANGE MASTER TO
|
||||||
master_port=<MASTER_PORT1>,
|
master_port=<MASTER_PORT1>,
|
||||||
master_log_file = 'master-bin.000001',
|
master_log_file = 'master-bin.000001',
|
||||||
master_log_pos = 106 ;
|
master_log_pos = 107 ;
|
||||||
start slave;
|
start slave;
|
||||||
INSERT INTO t1 VALUES ("row2","will go away",2),("row3","will change",3),("row4","D",4);
|
INSERT INTO t1 VALUES ("row2","will go away",2),("row3","will change",3),("row4","D",4);
|
||||||
DELETE FROM t1 WHERE c3 = 1;
|
DELETE FROM t1 WHERE c3 = 1;
|
||||||
|
Reference in New Issue
Block a user