diff options
author | He Zhenxing <hezx@mysql.com> | 2008-09-28 15:34:25 +0800 |
---|---|---|
committer | He Zhenxing <hezx@mysql.com> | 2008-09-28 15:34:25 +0800 |
commit | 0d2025e1d4c0b80a13bff64165a06ff71721a7b8 (patch) | |
tree | 0d4f8b334d9ff48090bce768035078349e9f98f2 /sql/rpl_rli.cc | |
parent | 6a4af260cc5d41cbbca6b4744682da4ee11d03d1 (diff) | |
download | mariadb-git-0d2025e1d4c0b80a13bff64165a06ff71721a7b8.tar.gz |
BUG#38734 rpl_server_id2 sync_with_master failed
Rotate event is automatically generated and written when rotating binary
log or relay log. Rotate events for relay logs are usually ignored by slave
SQL thread becuase they have the same server id as that of the slave.
However, if --replicate-same-server-id is enabled, rotate event
for relay log would be treated as if it's a rotate event from master, and
would be executed by slave to update the rli->group_master_log_name and
rli->group_master_log_pos to a wrong value and cause the MASTER_POS_WAIT
function to fail and return NULL.
This patch fixed this problem by setting a flag bit (LOG_EVENT_RELAY_LOG_F)
in the event to tell the SQL thread to ignore these Rotate events generated
for relay logs.
This patch also added another binlog event flag bit (LOG_EVENT_ARTIFICIAL_F)
to distinquish faked events, the method used before this was by checking if
log_pos was zero.
Diffstat (limited to 'sql/rpl_rli.cc')
-rw-r--r-- | sql/rpl_rli.cc | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sql/rpl_rli.cc b/sql/rpl_rli.cc index b6dfd1a1dc8..3a0f784d195 100644 --- a/sql/rpl_rli.cc +++ b/sql/rpl_rli.cc @@ -155,6 +155,7 @@ int init_relay_log_info(Relay_log_info* rli, sql_print_error("Failed in open_log() called from init_relay_log_info()"); DBUG_RETURN(1); } + rli->relay_log.is_relay_log= TRUE; } /* if file does not exist */ |