From: Date: March 8 2008 11:15am Subject: bk commit into 6.0 tree (aelkin:1.2590) BUG#34686 List-Archive: http://lists.mysql.com/commits/43642 X-Bug: 34686 Message-Id: <200803081015.m28AFr7R012642@mysql1000> Below is the list of changes that have just been committed into a local 6.0 repository of aelkin. When aelkin 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-03-08 12:14:47+02:00, aelkin@mysql1000.(none) +2 -0 Bug #34686 change master w/o explict master_heartbeat_period dont reset period to default The original patch has been pushed to 5.1-telco-6.3. This separate one is for 6.0 because merging is in reverse: 6.0->telco. CHANGE Master w/o the explicit master_heartbeat_period is supposed to reset the period to the value of @@global.slave_net_timeout/2. However, there was a possibility to get the hb status un-reset preserving its former value. Fixed with adding a rule to reset to the default in change_master(). sql/sql_repl.cc ensuring hb repiod gets reset to the specified default. mysql-test/suite/rpl/t/rpl_heartbeat.test@stripped, 2008-03-08 12:14:45+02:00, aelkin@mysql1000.(none) +10 -1 adding explanation to disable_warnings instuction. sql/sql_repl.cc@stripped, 2008-03-08 12:14:45+02:00, aelkin@mysql1000.(none) +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 2008-02-03 11:00:47 +02:00 +++ b/mysql-test/suite/rpl/t/rpl_heartbeat.test 2008-03-08 12:14:45 +02:00 @@ -16,8 +16,17 @@ connection master; reset master; connection slave; -set @@global.slave_net_timeout= 10; +# there can be a warning if mtr set the global init value bigger than +# the following assignment. The warning is a grace for the user +# to warn her that the new value of the global var is bigger than +# the current value of the hb period, i.e the sanity condition +# 0 < hb < slave_net_timeout does not hold. +# The warning has to be disabled as mtr can change the init value +# for slave_net_timeout +--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 2008-02-19 14:59:09 +02:00 +++ b/sql/sql_repl.cc 2008-03-08 12:14:45 +02:00 @@ -1255,6 +1255,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);