List:Commits« Previous MessageNext Message »
From:Serge.Kozlov Date:February 4 2011 3:30pm
Subject:Re: bzr commit into mysql-5.5 branch (Serge.Kozlov:3301) Bug#43828
Bug#59494
View as plain text  
04.02.2011 16:52, Sven Sandberg пишет:
> Hi Serge,
>
> Thanks for updating the test and adding asserts. Just two things need 
> to be fixed:
> - some code is not needed now that you use assert
> - the second assert condition is wrong (it's a copy of the first one)
> Can you fix this? See comments inline.

Fixed.
http://lists.mysql.com/commits/130440

>
>
> On 02/04/2011 11:51 AM, Serge Kozlov wrote:
>> #At file:///home/ksm/oracle/repo/QA/bugs/build-5.5/ based on 
>> revid:dmitry.shulga@stripped
>>
>> 3301 Serge Kozlov 2011-02-04
>> Bug#43828, Bug#59494.
>> After introducing new way of initialization of replication the 
>> setting different heartbeat periods for slaves was missed.
>> Added asserts
>>
>> modified:
>> mysql-test/suite/rpl/r/rpl_heartbeat_2slaves.result
>> mysql-test/suite/rpl/t/rpl_heartbeat_2slaves.test
>> === modified file 'mysql-test/suite/rpl/r/rpl_heartbeat_2slaves.result'
>> --- a/mysql-test/suite/rpl/r/rpl_heartbeat_2slaves.result 2010-12-19 
>> 17:15:12 +0000
>> +++ b/mysql-test/suite/rpl/r/rpl_heartbeat_2slaves.result 2011-02-04 
>> 10:51:32 +0000
>> @@ -2,13 +2,22 @@ include/rpl_init.inc [topology=1->2,1->3
>> include/rpl_connect.inc [creating master]
>> include/rpl_connect.inc [creating slave_1]
>> include/rpl_connect.inc [creating slave_2]
>> +include/stop_slave.inc
>> +CHANGE MASTER TO MASTER_HEARTBEAT_PERIOD = 0.1;
>> +include/start_slave.inc
>> +include/stop_slave.inc
>> +CHANGE MASTER TO MASTER_HEARTBEAT_PERIOD = 1;
>> +include/start_slave.inc
>> Slave has received heartbeat event
>> slave_2 has received heartbeat event
>> -slave_1 has received more heartbeats than slave_2 (1 means 'yes'): 0
>> +include/assert.inc [slave_1 should have received more heartbeats 
>> than slave_2]
>>
>> include/rpl_stop_slaves.inc
>> include/rpl_change_topology.inc [new topology=1->3->2]
>> include/rpl_start_slaves.inc
>> +include/stop_slave.inc
>> +CHANGE MASTER TO MASTER_HEARTBEAT_PERIOD=0.1;
>> +include/start_slave.inc
>> slave_1 has received heartbeat event
>> [on master]
>> CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(10), c LONGTEXT);
>> @@ -26,7 +35,7 @@ Tables_in_test
>> [on master]
>> creating updates on master and send to slave_2 during 5 second
>> [on slave_1]
>> -slave_1 has received heartbeats (1 means 'yes'): 0
>> +include/assert.inc [slave_1 should have received heartbeats]
>>
>> *** Clean up ***
>> DROP TABLE t1;
>>
>> === modified file 'mysql-test/suite/rpl/t/rpl_heartbeat_2slaves.test'
>> --- a/mysql-test/suite/rpl/t/rpl_heartbeat_2slaves.test 2010-12-19 
>> 17:15:12 +0000
>> +++ b/mysql-test/suite/rpl/t/rpl_heartbeat_2slaves.test 2011-02-04 
>> 10:51:32 +0000
>> @@ -20,7 +20,19 @@
>> --source include/rpl_connect.inc
>>
>> #
>> -# Testing heartbeat
>> +# Set different heartbeat periods for slaves
>> +#
>> +--connection slave_1
>> +--source include/stop_slave.inc
>> +CHANGE MASTER TO MASTER_HEARTBEAT_PERIOD = 0.1;
>> +--source include/start_slave.inc
>> +--connection slave_2
>> +--source include/stop_slave.inc
>> +CHANGE MASTER TO MASTER_HEARTBEAT_PERIOD = 1;
>> +--source include/start_slave.inc
>> +
>> +#
>> +# Testing heartbeat for one master and two slaves
>> #
>>
>> # Check that heartbeat events sent to both slaves with correct periods
>> @@ -39,10 +51,11 @@ let $slave_2_rcvd_heartbeats= query_get_
>> --echo slave_2 has received heartbeat event
>> --connection slave_1
>> let $slave_1_rcvd_heartbeats= query_get_value(SHOW STATUS LIKE 
>> 'slave_received_heartbeats', Value, 1);
>
> I think you can remove all this:
>
> --echo slave_2 has received heartbeat event
> --connection slave_1
> let $slave_1_rcvd_heartbeats= query_get_value(SHOW STATUS LIKE 
> 'slave_received_heartbeats', Value, 1);
> let $result= query_get_value(SELECT ($slave_1_rcvd_heartbeats DIV 
> $slave_2_rcvd_heartbeats) > 1 AS Result, Result, 1);
> --echo slave_1 has received more heartbeats than slave_2 (1 means 
> 'yes'): $result
> --echo
>
>
>> -let $result= query_get_value(SELECT ($slave_1_rcvd_heartbeats DIV 
>> $slave_2_rcvd_heartbeats)> 1 AS Result, Result, 1);
>> ---echo slave_1 has received more heartbeats than slave_2 (1 means 
>> 'yes'): $result
>> ---echo
>>
>> +--let $assert_cond= [slave_1:SHOW STATUS LIKE 
>> "slave_received_heartbeats", Value, 1]> [slave_2:SHOW STATUS LIKE 
>> "slave_received_heartbeats", Value, 1]
>> +--let $assert_text= slave_1 should have received more heartbeats 
>> than slave_2
>> +--source include/assert.inc
>> +--echo
>>
>> # Create topology master->slave_2->slave_1 and check that slave_1
>> # receives heartbeat while slave_2 gets data.
>> @@ -54,6 +67,10 @@ let $result= query_get_value(SELECT ($sl
>> --let $rpl_topology= 1->3->2
>> --source include/rpl_change_topology.inc
>> --source include/rpl_start_slaves.inc
>> +--connection slave_1
>> +--source include/stop_slave.inc
>> +CHANGE MASTER TO MASTER_HEARTBEAT_PERIOD=0.1;
>> +--source include/start_slave.inc
>>
>> # Check heartbeat for new replication channel slave_2->slave
>> let $status_var= slave_received_heartbeats;
>> @@ -104,8 +121,9 @@ while ($i) {
>> --enable_query_log
>> --connection slave_1
>> --echo [on slave_1]
>> -let $result= query_get_value(SELECT ($slave_1_rcvd_heartbeats_after 
>> - $slave_1_rcvd_heartbeats_before)> 0 AS Result, Result, 1);
>> ---echo slave_1 has received heartbeats (1 means 'yes'): $result
>> +--let $assert_cond= [slave_1:SELECT $slave_1_rcvd_heartbeats_after 
>> AS Value, Value, 1]> [slave_2:SELECT $slave_1_rcvd_heartbeats_before 
>> AS Value, Value, 1]
>> +--let $assert_text= slave_1 should have received heartbeats
>> +--source include/assert.inc
>
> The above is not the correct condition (it's the same condition as 
> above), can you fix it?
>
> /Sven


-- 
Serge Kozlov, QA Developer,
Replication team,
Oracle Development SPB/MySQL, www.mysql.com

Thread
bzr commit into mysql-5.5 branch (Serge.Kozlov:3301) Bug#43828 Bug#59494Serge Kozlov4 Feb
  • Re: bzr commit into mysql-5.5 branch (Serge.Kozlov:3301) Bug#43828Bug#59494Sven Sandberg4 Feb
    • Re: bzr commit into mysql-5.5 branch (Serge.Kozlov:3301) Bug#43828Bug#59494Serge.Kozlov4 Feb