MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:He Zhenxing Date:September 29 2010 5:14am
Subject:Re: bzr commit into mysql-5.1-bugteam branch (alfranio.correia:3504)
Bug#55675
View as plain text  
Nice work, Please look below for one question.

Alfranio Correia wrote:
> #At
> file:///home/acorreia/workspace.sun/repository.mysql.new/bzrwork/bug-55675/mysql-5.1-bugteam/
> based on revid:alfranio.correia@stripped
> 
>  3504 Alfranio Correia	2010-09-27
>       BUG#55675 rpl.rpl_log_pos fails sporadically with error binlog truncated in the
> middle
>       
>       There are two calls to read_log_event() on master in mysql_binlog_send(),
>       each will read 19 bytes, and the error of the second read_log_event() will
>       be reported to slave.
>       
>       The second read_log_event() will start from position 94 (75 + 19) to 113
>       (75 + 19 + 19), the end position 113 is larger than the size 106 of binary
>       log that only have a FD, but because there is a call to mtr.suppression:
>       
>       call mtr.add_suppression ("Slave I/O: Got fatal error 1236 from master when
> reading data from binary");
>       
>       which will write some binary events to the file, and so normally the
>       size of the binlog on master before slave connection will be large enough
>       for the second read_log_event(). 
>       
>       However, mysql_binlog_send() does not use the same IO_CACHE that is used to
> write 
>       into binary log (i.e. mysql_bin_log.log_file) for the hot binary log. It opens
>       the binary log file directly by calling open_binlog() and create a separated
>       IO_CACHE. So there is a possibily that after a master has flushed the binary
> log
>       file, the content has been cached by the filesystem, and has not yet updated
> the
>       on disk file yet. If this happens, then a slave will only see part of the
> file,
>       and thus the second read_log_event() will report event truncated error.
> 
>     modified:
>       mysql-test/suite/rpl/r/rpl_log_pos.result
>       mysql-test/suite/rpl/t/disabled.def
>       mysql-test/suite/rpl/t/rpl_log_pos.test
> === modified file 'mysql-test/suite/rpl/r/rpl_log_pos.result'
> --- a/mysql-test/suite/rpl/r/rpl_log_pos.result	2010-05-24 13:54:08 +0000
> +++ b/mysql-test/suite/rpl/r/rpl_log_pos.result	2010-09-27 09:07:48 +0000
> @@ -4,24 +4,27 @@ reset master;
>  reset slave;
>  drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
>  start slave;
> +include/stop_slave.inc
>  call mtr.add_suppression ("Slave I/O: Got fatal error 1236 from master when reading
> data from binary");
>  show master status;
>  File	Position	Binlog_Do_DB	Binlog_Ignore_DB
>  master-bin.000001	#	<Binlog_Do_DB>	<Binlog_Ignore_DB>
> +flush logs;
> +include/start_slave.inc
>  include/stop_slave.inc
> -change master to master_log_pos=MASTER_LOG_POS;
> +change master to master_log_file = 'MASTER_LOG_FILE',
> master_log_pos=MASTER_LOG_POS;
>  Read_Master_Log_Pos	75
>  start slave;
>  Last_IO_Error = Got fatal error 1236 from master when reading data from binary log:
> 'log event entry exceeded max_allowed_packet; Increase max_allowed_packet on master'
>  include/stop_slave.inc
>  show master status;
>  File	Position	Binlog_Do_DB	Binlog_Ignore_DB
> -master-bin.000001	#	<Binlog_Do_DB>	<Binlog_Ignore_DB>
> +master-bin.000002	#	<Binlog_Do_DB>	<Binlog_Ignore_DB>
>  create table if not exists t1 (n int);
>  drop table if exists t1;
>  create table t1 (n int);
>  insert into t1 values (1),(2),(3);
> -change master to master_log_pos=MASTER_LOG_POS;
> +change master to master_log_file = 'MASTER_LOG_FILE',
> master_log_pos=MASTER_LOG_POS;
>  start slave;
>  select * from t1 ORDER BY n;
>  n
> 
> === modified file 'mysql-test/suite/rpl/t/disabled.def'
> --- a/mysql-test/suite/rpl/t/disabled.def	2010-09-10 10:36:15 +0000
> +++ b/mysql-test/suite/rpl/t/disabled.def	2010-09-27 09:07:48 +0000
> @@ -11,4 +11,3 @@
>  ##############################################################################
>  
>  rpl_row_create_table : Bug#51574 Feb 27 2010 andrei failed different way than
> earlier with bug#45576
> -rpl_log_pos : BUG#55675 Sep 10 2010 27 2010 alfranio rpl.rpl_log_pos fails
> sporadically with error binlog truncated in the middle
> 
> === modified file 'mysql-test/suite/rpl/t/rpl_log_pos.test'
> --- a/mysql-test/suite/rpl/t/rpl_log_pos.test	2010-05-24 13:54:08 +0000
> +++ b/mysql-test/suite/rpl/t/rpl_log_pos.test	2010-09-27 09:07:48 +0000
> @@ -11,13 +11,26 @@
>  # Passes with rbr no problem, removed statement include [jbm]
>  
>  source include/master-slave.inc;
> +
> +--connection slave
> +--source include/stop_slave.inc
> +
> +--connection master
>  call mtr.add_suppression ("Slave I/O: Got fatal error 1236 from master when reading
> data from binary");
>  source include/show_master_status.inc;
> +flush logs;
> +
> +--connection slave
> +--source include/start_slave.inc
> +

why stop and start slave? I think they are not necessary.

> +--connection master
>  sync_slave_with_master;
> -source include/stop_slave.inc;
>  
> ---replace_result 75 MASTER_LOG_POS
> -change master to master_log_pos=75;
> +--connection slave
> +--source include/stop_slave.inc
> +
> +--replace_result master-bin.000001 MASTER_LOG_FILE 75 MASTER_LOG_POS
> +change master to master_log_file = 'master-bin.000001', master_log_pos=75;
>  let $status_items= Read_Master_Log_Pos;
>  source include/show_slave_status.inc;
>  start slave;
> @@ -26,20 +39,20 @@ let $show_slave_io_error= 1;
>  source include/wait_for_slave_io_error.inc;
>  source include/stop_slave.inc;
>  
> -connection master;
> +--connection master
>  source include/show_master_status.inc;
>  create table if not exists t1 (n int);
>  drop table if exists t1;
>  create table t1 (n int);
>  insert into t1 values (1),(2),(3);
>  save_master_pos;
> -connection slave;
> ---replace_result 4 MASTER_LOG_POS
> -change master to master_log_pos=4;
> +--connection slave
> +--replace_result master-bin.000001 MASTER_LOG_FILE 4 MASTER_LOG_POS
> +change master to master_log_file = 'master-bin.000001', master_log_pos=4;
>  start slave;
>  sync_with_master;
>  select * from t1 ORDER BY n;
> -connection master;
> +--connection master
>  drop table t1;
>  sync_slave_with_master;
>  


Thread
bzr commit into mysql-5.1-bugteam branch (alfranio.correia:3504) Bug#55675Alfranio Correia27 Sep
  • Re: bzr commit into mysql-5.1-bugteam branch (alfranio.correia:3504)Bug#55675He Zhenxing29 Sep
    • Re: bzr commit into mysql-5.1-bugteam branch (alfranio.correia:3504)Bug#55675Alfranio Correia29 Sep