From: Date: February 20 2008 2:02pm Subject: bk commit into 5.1 tree (aelkin:1.2609) BUG#34686 List-Archive: http://lists.mysql.com/commits/42645 X-Bug: 34686 Message-Id: <200802201302.m1KD2EBr011492@mysql1000.dsl.inet.fi> Below is the list of changes that have just been committed into a local 5.1 repository of andrei. When andrei does a push these changes will be propagated to the main repository and, within 24 hours after the push, to the public repository. For information on how to access the public repository see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html ChangeSet@stripped, 2008-02-20 15:02:10+02:00, aelkin@stripped +2 -0 Bug #34686 change master w/o explict master_heartbeat_period dont reset period to default There appeared failures on 5.1-telco-6.3 tree after mtr started using bigger value to init @@global.slave_net.timeout. Whereas the very first default setting was correct to follow hb=slave_net_timeout/2 rule rule, the following CHANGE master w/o the keyword failed. Fixed with enforcing logics in change_master() to reset the heartbeat period to the specified slave_net_timeout/2 when the option is not passed to CHANGE master command. mysql-test/suite/rpl/t/rpl_heartbeat.test@stripped, 2008-02-20 15:02:08+02:00, aelkin@stripped +4 -1 Bug #34686 change master w/o explict master_heartbeat_period dont reset period to default There apeared failures on 5.1-telco-6.3 tree after mtr started using bigger value to init @@global.slave_net.timeout. Fixed with enforcing logics in change_master() to reset the heartbeat period to the specified slave_net_timeout/2 when the option is not passed to the CHANGE master statement. sql/sql_repl.cc@stripped, 2008-02-20 15:02:08+02:00, aelkin@stripped +3 -0 ensuring hb repiod gets reset to the specified default. diff -Nrup a/mysql-test/suite/rpl/t/rpl_heartbeat.test b/mysql-test/suite/rpl/t/rpl_heartbeat.test --- a/mysql-test/suite/rpl/t/rpl_heartbeat.test 2007-10-13 23:41:06 +03:00 +++ b/mysql-test/suite/rpl/t/rpl_heartbeat.test 2008-02-20 15:02:08 +02:00 @@ -16,8 +16,11 @@ connection master; reset master; connection slave; +# there can be a warning if mtr set the global init value bigger than +# the following assignment. +--disable_warnings set @@global.slave_net_timeout= 10; - +--enable_warnings ### ### Checking the range ### diff -Nrup a/sql/sql_repl.cc b/sql/sql_repl.cc --- a/sql/sql_repl.cc 2007-10-15 12:38:17 +03:00 +++ b/sql/sql_repl.cc 2008-02-20 15:02:08 +02:00 @@ -1257,6 +1257,9 @@ bool change_master(THD* thd, MASTER_INFO mi->connect_retry = lex_mi->connect_retry; if (lex_mi->heartbeat_opt != LEX_MASTER_INFO::LEX_MI_UNCHANGED) mi->heartbeat_period = lex_mi->heartbeat_period; + else + mi->heartbeat_period= (float) min(SLAVE_MAX_HEARTBEAT_PERIOD, + (slave_net_timeout/2.0)); mi->received_heartbeats= LL(0); // counter lives until master is CHANGEd if (lex_mi->ssl != LEX_MASTER_INFO::LEX_MI_UNCHANGED) mi->ssl= (lex_mi->ssl == LEX_MASTER_INFO::LEX_MI_ENABLE);