Hi, Sven.
Thanks for review. See notes below.
Sven Sandberg пишет:
> Hi Serge!
>
> Good work with identifying the performance bottlenecks in our suite! I
> have some comments, see below.
>
> /Sven
>
>
>
> Serge Kozlov wrote:
>> #At file:///home/ksm/sun/repo/WL4416/mysql-6.0-rpl/
>>
>> 2726 Serge Kozlov 2008-11-14
>> WL#4112:
>
> This is WL#4416, please update changeset comment.
>
>> 1. Skip sleeps for primitives from rpl_extra if used engine is not NDB
>> 2. Remove sleep from rpl_stm_000001.test
>> modified:
>> mysql-test/extra/rpl_tests/rpl_row_blob.test
>> mysql-test/extra/rpl_tests/rpl_row_func003.test
>> mysql-test/extra/rpl_tests/rpl_row_sp003.test
>> mysql-test/extra/rpl_tests/rpl_stm_000001.test
>> mysql-test/extra/rpl_tests/rpl_trig004.test
>>
>> === modified file 'mysql-test/extra/rpl_tests/rpl_row_blob.test'
>> --- a/mysql-test/extra/rpl_tests/rpl_row_blob.test 2007-06-18 13:36:10 +0000
>> +++ b/mysql-test/extra/rpl_tests/rpl_row_blob.test 2008-11-13 21:28:36 +0000
>> @@ -5,6 +5,9 @@
>> # correctly.
>> ################################################
>>
>> +# Set if used ndbcluster engine
>> +let $is_ndb= `SELECT UPPER(LEFT('$engine_type',3)) = 'NDB'`;
>> +
>> # Pre test clean up section
>> connection master;
>> --disable_warnings
>> @@ -36,7 +39,9 @@ SELECT LENGTH(data) FROM test.t1 WHERE c
>> save_master_pos;
>> connection slave;
>> sync_with_master;
>> -sleep 5;
>> +if ($is_ndb) {
>> + sleep 5;
>> +}
>
> I suggest to create an include file for this
> (include/wait_for_ndb_to_binlog.inc). Benefits:
>
> - Less code.
>
> - More clear what we are waiting for when you read the test.
>
> - Easier to change implementation (e.g., if we need to change sleep
> interval in all tests, or if we invent a better way to wait than using
> sleeps).
Could you explain what code did you mean? Sleeping for NDB usually means
waiting until NDB injector get a data from cluster and write into
binlog. But we have no direct access to NDB injector state...
>
>> --echo
>> --echo **** Data Insert Validation Slave Section test.t1 ****
>> --echo
>> @@ -61,7 +66,9 @@ SELECT LENGTH(data) FROM test.t1 WHERE c
>> save_master_pos;
>> connection slave;
>> sync_with_master;
>> -sleep 5;
>> +if ($is_ndb) {
>> + sleep 5;
>> +}
>> --echo
>> --echo **** Data Update Validation Slave Section test.t1 ****
>> --echo
>> @@ -132,7 +139,9 @@ FROM test.t2 WHERE c1=2;
>> save_master_pos;
>> connection slave;
>> sync_with_master;
>> -sleep 5;
>> +if ($is_ndb) {
>> + sleep 5;
>> +}
>> --echo
>> --echo **** Data Insert Validation Slave Section test.t2 ****
>> --echo
>> @@ -160,7 +169,9 @@ FROM test.t2 WHERE c1=2;
>> save_master_pos;
>> connection slave;
>> sync_with_master;
>> -sleep 5;
>> +if ($is_ndb) {
>> + sleep 5;
>> +}
>> --echo
>> --echo **** Data Update Validation Slave Section test.t2 ****
>> --echo
>>
>> === modified file 'mysql-test/extra/rpl_tests/rpl_row_func003.test'
>> --- a/mysql-test/extra/rpl_tests/rpl_row_func003.test 2007-06-18 13:36:10 +0000
>> +++ b/mysql-test/extra/rpl_tests/rpl_row_func003.test 2008-11-13 21:28:36 +0000
>> @@ -18,6 +18,9 @@
>> # Vs slave. #
>> #############################################################################
>>
>> +# Set if used ndbcluster engine
>> +let $is_ndb= `SELECT UPPER(LEFT('$engine_type',3)) = 'NDB'`;
>> +
>> # Begin clean up test section
>> connection master;
>> --disable_warnings
>> @@ -44,9 +47,13 @@ END|
>> delimiter ;|
>>
>> INSERT INTO test.t1 VALUES (null,test.f1()),(null,test.f1()),(null,test.f1());
>> -sleep 6;
>> +if ($is_ndb) {
>> + sleep 6;
>> +}
>> INSERT INTO test.t1 VALUES (null,test.f1()),(null,test.f1()),(null,test.f1());
>> -sleep 6;
>> +if ($is_ndb) {
>> + sleep 6;
>> +}
>>
>> #Select in this test are used for debugging
>> #select * from test.t1;
>>
>> === modified file 'mysql-test/extra/rpl_tests/rpl_row_sp003.test'
>> --- a/mysql-test/extra/rpl_tests/rpl_row_sp003.test 2007-06-18 13:36:10 +0000
>> +++ b/mysql-test/extra/rpl_tests/rpl_row_sp003.test 2008-11-13 21:28:36 +0000
>> @@ -44,7 +44,9 @@ SELECT * FROM test.t1;
>> # Added sleep for use with NDB to ensure that
>> # the injector thread will populate log before
>> # we switch to the slave.
>> -sleep 5;
>> +if (`SELECT UPPER(LEFT('$engine_type', 3)) = 'NDB'`) {
>> + sleep 5;
>> +}
>> sync_slave_with_master;
>> connection slave;
>> SELECT * FROM test.t1;
>>
>> === modified file 'mysql-test/extra/rpl_tests/rpl_stm_000001.test'
>> --- a/mysql-test/extra/rpl_tests/rpl_stm_000001.test 2007-12-12 17:19:24 +0000
>> +++ b/mysql-test/extra/rpl_tests/rpl_stm_000001.test 2008-11-13 21:28:36 +0000
>> @@ -63,13 +63,16 @@ while ($1)
>> dec $1;
>> }
>> enable_query_log;
>> +save_master_pos;
>> +let $slave_param= Read_Master_Log_Pos;
>> +let $slave_param_value= query_get_value("show master status", Position, 1);
>
> Please use include/sync_slave_io_with_master.inc instead.
Ok, agree.
>
>>
>> # Try to cause a large relay log lag on the slave by locking t1
>> connection slave;
>> lock tables t1 read;
>> start slave;
>> -#hope this is long enough for I/O thread to fetch over 16K relay log data
>> -sleep 3;
>> +# wait while IO thread fetch over 16k relay log data
>> +-- source include/wait_for_slave_param.inc
>> unlock tables;
>>
>> #test handling of aborted connection in the middle of update
>>
>> === modified file 'mysql-test/extra/rpl_tests/rpl_trig004.test'
>> --- a/mysql-test/extra/rpl_tests/rpl_trig004.test 2007-06-06 17:57:07 +0000
>> +++ b/mysql-test/extra/rpl_tests/rpl_trig004.test 2008-11-13 21:28:36 +0000
>> @@ -37,7 +37,9 @@ select * from test.t1;
>> select * from test.t2;
>> # Have to sleep for a few seconds to allow
>> # NDB injector thread to populate binlog
>> -sleep 10;
>> +if (`SELECT UPPER(LEFT('$engine_type', 3) = 'NDB'`) {
>> + sleep 10;
>> +}
>> sync_slave_with_master;
>> connection slave;
>> select * from test.t1;
>>
>>
>
>
--
Serge Kozlov, QA Developer
MySQL AB, Moscow, Russia, www.mysql.com
Office:
Are you MySQL certified? www.mysql.com/certification