Fix for BUG#1086. Now we don't preserve event's log_pos through
log-slave-updates since this causes unexpected values in Exec_master_log_pos in A->B->C replication setup, synchronization problems in master_pos_wait()... Still this brokes some functionality in sql/repl_failsafe.cc (but this file is not used now) mysql-test/r/rpl_log.result: SHOW BINLOG EVENTS for binlog on slave should give the same Orig_log_pos and Pos values sql/log_event.cc: Do not propagate our master's log pos to our bin log sql/repl_failsafe.cc: Added comment about broken SHOW NEW MASTER sql/slave.cc: Do not propagate our master's log pos to our bin log sql/sql_class.cc: THD::log_pos is no longer needed sql/sql_class.h: THD::log_pos is no longer needed sql/sql_parse.cc: Added comment about broken SHOW NEW MASTER
This commit is contained in:
parent
d43a347db1
commit
e3541b8a97
@ -85,15 +85,15 @@ slave-bin.001 263 Query 1 263 use test; drop table t1
|
|||||||
slave-bin.001 311 Query 1 311 use test; create table t1 (word char(20) not null)
|
slave-bin.001 311 Query 1 311 use test; create table t1 (word char(20) not null)
|
||||||
slave-bin.001 386 Create_file 1 386 db=test;table=t1;file_id=1;block_len=581
|
slave-bin.001 386 Create_file 1 386 db=test;table=t1;file_id=1;block_len=581
|
||||||
slave-bin.001 1065 Exec_load 1 1056 ;file_id=1
|
slave-bin.001 1065 Exec_load 1 1056 ;file_id=1
|
||||||
slave-bin.001 1088 Query 1 1079 use test; drop table t1
|
slave-bin.001 1088 Query 1 1088 use test; drop table t1
|
||||||
slave-bin.001 1136 Query 1 4 use test; create table t5 (a int)
|
slave-bin.001 1136 Query 1 1136 use test; create table t5 (a int)
|
||||||
slave-bin.001 1194 Query 1 62 use test; drop table t5
|
slave-bin.001 1194 Query 1 1194 use test; drop table t5
|
||||||
slave-bin.001 1242 Rotate 2 1242 slave-bin.002;pos=4
|
slave-bin.001 1242 Rotate 2 1242 slave-bin.002;pos=4
|
||||||
show binlog events in 'slave-bin.002' from 4;
|
show binlog events in 'slave-bin.002' from 4;
|
||||||
Log_name Pos Event_type Server_id Orig_log_pos Info
|
Log_name Pos Event_type Server_id Orig_log_pos Info
|
||||||
slave-bin.002 4 Query 1 110 use test; create table t1 (n int)
|
slave-bin.002 4 Query 1 4 use test; create table t1 (n int)
|
||||||
slave-bin.002 62 Query 1 168 use test; insert into t1 values (1)
|
slave-bin.002 62 Query 1 62 use test; insert into t1 values (1)
|
||||||
slave-bin.002 122 Query 1 228 use test; drop table t1
|
slave-bin.002 122 Query 1 122 use test; drop table t1
|
||||||
show slave status;
|
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
|
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 MASTER_PORT 1 master-bin.002 276 slave-relay-bin.003 211 master-bin.002 Yes Yes 0 0 276 211
|
127.0.0.1 root MASTER_PORT 1 master-bin.002 276 slave-relay-bin.003 211 master-bin.002 Yes Yes 0 0 276 211
|
||||||
|
@ -119,12 +119,11 @@ const char* Log_event::get_type_str()
|
|||||||
|
|
||||||
#ifndef MYSQL_CLIENT
|
#ifndef MYSQL_CLIENT
|
||||||
Log_event::Log_event(THD* thd_arg, uint16 flags_arg, bool using_trans)
|
Log_event::Log_event(THD* thd_arg, uint16 flags_arg, bool using_trans)
|
||||||
:temp_buf(0), exec_time(0), cached_event_len(0), flags(flags_arg),
|
:log_pos(0), temp_buf(0), exec_time(0), cached_event_len(0),
|
||||||
thd(thd_arg)
|
flags(flags_arg), thd(thd_arg)
|
||||||
{
|
{
|
||||||
server_id = thd->server_id;
|
server_id = thd->server_id;
|
||||||
when = thd->start_time;
|
when = thd->start_time;
|
||||||
log_pos = thd->log_pos;
|
|
||||||
cache_stmt= (using_trans &&
|
cache_stmt= (using_trans &&
|
||||||
(thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)));
|
(thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)));
|
||||||
}
|
}
|
||||||
|
@ -249,6 +249,18 @@ static int find_target_pos(LEX_MASTER_INFO *mi, IO_CACHE *log, char *errmsg)
|
|||||||
/* Impossible */
|
/* Impossible */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
Before 4.0.15 we had a member of THD called log_pos, it was meant for
|
||||||
|
failsafe replication code in repl_failsafe.cc which is disabled until
|
||||||
|
it is reworked. Event's log_pos used to be preserved through
|
||||||
|
log-slave-updates to make code in repl_failsafe.cc work (this
|
||||||
|
function, SHOW NEW MASTER); but on the other side it caused unexpected
|
||||||
|
values in Exec_master_log_pos in A->B->C replication setup,
|
||||||
|
synchronization problems in master_pos_wait(), ... So we
|
||||||
|
(Dmitri & Guilhem) removed it.
|
||||||
|
|
||||||
|
So for now this function is broken.
|
||||||
|
*/
|
||||||
|
|
||||||
int translate_master(THD* thd, LEX_MASTER_INFO* mi, char* errmsg)
|
int translate_master(THD* thd, LEX_MASTER_INFO* mi, char* errmsg)
|
||||||
{
|
{
|
||||||
@ -414,6 +426,9 @@ static Slave_log_event* find_slave_event(IO_CACHE* log,
|
|||||||
return (Slave_log_event*)ev;
|
return (Slave_log_event*)ev;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
This function is broken now. See comment for translate_master().
|
||||||
|
*/
|
||||||
|
|
||||||
int show_new_master(THD* thd)
|
int show_new_master(THD* thd)
|
||||||
{
|
{
|
||||||
|
@ -2253,7 +2253,6 @@ static int exec_relay_log_event(THD* thd, RELAY_LOG_INFO* rli)
|
|||||||
if (!ev->when)
|
if (!ev->when)
|
||||||
ev->when = time(NULL);
|
ev->when = time(NULL);
|
||||||
ev->thd = thd;
|
ev->thd = thd;
|
||||||
thd->log_pos = ev->log_pos;
|
|
||||||
exec_res = ev->exec_event(rli);
|
exec_res = ev->exec_event(rli);
|
||||||
DBUG_ASSERT(rli->sql_thd==thd);
|
DBUG_ASSERT(rli->sql_thd==thd);
|
||||||
delete ev;
|
delete ev;
|
||||||
|
@ -125,7 +125,6 @@ THD::THD():user_time(0),fatal_error(0),last_insert_id_used(0),
|
|||||||
where="field list";
|
where="field list";
|
||||||
server_id = ::server_id;
|
server_id = ::server_id;
|
||||||
slave_net = 0;
|
slave_net = 0;
|
||||||
log_pos = 0;
|
|
||||||
command=COM_CONNECT;
|
command=COM_CONNECT;
|
||||||
set_query_id=1;
|
set_query_id=1;
|
||||||
db_access=NO_ACCESS;
|
db_access=NO_ACCESS;
|
||||||
|
@ -472,7 +472,6 @@ public:
|
|||||||
*/
|
*/
|
||||||
ulong slave_proxy_id;
|
ulong slave_proxy_id;
|
||||||
NET* slave_net; // network connection from slave -> m.
|
NET* slave_net; // network connection from slave -> m.
|
||||||
my_off_t log_pos;
|
|
||||||
|
|
||||||
/* Used by the sys_var class to store temporary values */
|
/* Used by the sys_var class to store temporary values */
|
||||||
union
|
union
|
||||||
|
@ -1458,6 +1458,7 @@ mysql_execute_command(void)
|
|||||||
{
|
{
|
||||||
if (check_global_access(thd, REPL_SLAVE_ACL))
|
if (check_global_access(thd, REPL_SLAVE_ACL))
|
||||||
goto error;
|
goto error;
|
||||||
|
/* This query don't work now. See comment in repl_failsafe.cc */
|
||||||
#ifndef WORKING_NEW_MASTER
|
#ifndef WORKING_NEW_MASTER
|
||||||
net_printf(&thd->net, ER_NOT_SUPPORTED_YET, "SHOW NEW MASTER");
|
net_printf(&thd->net, ER_NOT_SUPPORTED_YET, "SHOW NEW MASTER");
|
||||||
res= 1;
|
res= 1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user