mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 20:42:30 +01:00
Replication:
as the I/O thread filters on the server id, we must test replicate_same_server_id in it (on top of in the SQL thread).
This commit is contained in:
parent
4e2b94dea6
commit
cd18476e34
2 changed files with 8 additions and 10 deletions
|
@ -1,17 +1,19 @@
|
|||
slave stop;
|
||||
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;
|
||||
slave start;
|
||||
start slave;
|
||||
drop table if exists t1;
|
||||
Warnings:
|
||||
Note 1051 Unknown table 't1'
|
||||
create table t1 (n int);
|
||||
reset master;
|
||||
stop slave;
|
||||
change master to master_port=SLAVE_PORT;
|
||||
show slave status;
|
||||
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space
|
||||
127.0.0.1 root SLAVE_PORT 1 4 slave-relay-bin.001 4 No No 0 0 0 #
|
||||
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
|
||||
127.0.0.1 root SLAVE_PORT 1 4 slave-relay-bin.000001 4 No No # 0 0 0 4 None 0 No NULL
|
||||
start slave;
|
||||
insert into t1 values (1);
|
||||
select * from t1;
|
||||
|
|
|
@ -2833,11 +2833,6 @@ static int exec_relay_log_event(THD* thd, RELAY_LOG_INFO* rli)
|
|||
log files themselves.
|
||||
*/
|
||||
|
||||
/*
|
||||
TODO: when this is merged into 4.1, one needs to update queue_event() to
|
||||
add a similar test for replicate_same_server_id, because in 4.1 the I/O
|
||||
thread is also filtering events based on the server id.
|
||||
*/
|
||||
if ((ev->server_id == (uint32) ::server_id && !replicate_same_server_id) ||
|
||||
(rli->slave_skip_counter && type_code != ROTATE_EVENT))
|
||||
{
|
||||
|
@ -3716,7 +3711,8 @@ int queue_event(MASTER_INFO* mi,const char* buf, ulong event_len)
|
|||
direct master (an unsupported, useless setup!).
|
||||
*/
|
||||
|
||||
if (uint4korr(buf + SERVER_ID_OFFSET) == ::server_id)
|
||||
if ((uint4korr(buf + SERVER_ID_OFFSET) == ::server_id) &&
|
||||
!replicate_same_server_id)
|
||||
{
|
||||
/*
|
||||
Do not write it to the relay log.
|
||||
|
|
Loading…
Reference in a new issue