List:Commits« Previous MessageNext Message »
From:Mats Kindahl Date:March 9 2011 1:19pm
Subject:Re: bzr commit into mysql-5.5 branch (marc.alff:3357) Bug#11766528
View as plain text  
Hi Marc,

Patch is approved, but see some minor comments below.

On 03/01/2011 05:39 PM, Marc Alff wrote:
> #At file:///Users/malff/BZR_TREE/mysql-5.5-bug11766528/ based on
> revid:tor.didriksen@stripped
>
>  3357 Marc Alff	2011-03-01
>       Bug#11766528 PERFORMANCE_SCHEMA TRACKS BOTH BINARY AND RELAY LOGS IN THE SAME
> EVENTS
>       
>       Before this fix, all the performance schema instrumentation for both the binary
> log
>       and the relay log would use the following instruments:
>       - wait/io/file/sql/binlog
>       - wait/io/file/sql/binlog_index
>       - wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_index
>       - wait/synch/cond/sql/MYSQL_BIN_LOG::update_cond
>       
>       This instrumentation is too general and can be more specific.
>       
>       With this fix, the binlog instrumentation is identical,
>       and the relay log instrumentation is changed to:
>       - wait/io/file/sql/relaylog
>       - wait/io/file/sql/relaylog_index
>       - wait/synch/mutex/sql/MYSQL_RELAY_LOG::LOCK_index
>       - wait/synch/cond/sql/MYSQL_RELAY_LOG::update_cond
>       
>       With this change, the performance instrumentation for the binary log and the
> relay log,
>       which share the same structure but have different uses, is more detailed.
>       This is especially important for hosts in the middle of a replication chain,
>       that are both masters (binlog) and slaves (relaylog).
>
>     added:
>       mysql-test/suite/perfschema/r/relaylog.result
>       mysql-test/suite/perfschema/t/relaylog.test
>     modified:
>       sql/log.cc
>       sql/log.h
>       sql/mysqld.cc
>       sql/mysqld.h
>       sql/rpl_rli.cc
> === added file 'mysql-test/suite/perfschema/r/relaylog.result'
> --- a/mysql-test/suite/perfschema/r/relaylog.result	1970-01-01 00:00:00 +0000
> +++ b/mysql-test/suite/perfschema/r/relaylog.result	2011-03-01 16:39:28 +0000
> @@ -0,0 +1,98 @@
> +include/master-slave.inc
> +[connection master]
> +drop table if exists test.t1;
> +reset master;
> +create table test.t1(a int);
> +drop table test.t1;
> +show binlog events from <binlog_start>;
> +Log_name	Pos	Event_type	Server_id	End_log_pos	Info
> +slave-bin.000001	#	Query	#	#	use `test`; create table test.t1(a int)
> +slave-bin.000001	#	Query	#	#	use `test`; DROP TABLE `t1` /* generated by server */
> +"============ Performance schema on master ============"
> +select * from performance_schema.file_summary_by_instance
> +where file_name like "%master-%" order by file_name;
>
> +FILE_NAME	EVENT_NAME	COUNT_READ	COUNT_WRITE	SUM_NUMBER_OF_BYTES_READ	SUM_NUMBER_OF_BYTES_WRITE
> +[DATADIR]master-bin.000001	wait/io/file/sql/binlog	6	4	221	329
> +[DATADIR]master-bin.index	wait/io/file/sql/binlog_index	0	2	0	40
> +select * from performance_schema.file_summary_by_instance
> +where file_name like "%slave-%" order by file_name;
>
> +FILE_NAME	EVENT_NAME	COUNT_READ	COUNT_WRITE	SUM_NUMBER_OF_BYTES_READ	SUM_NUMBER_OF_BYTES_WRITE
> +select * from performance_schema.file_summary_by_instance
> +where event_name like "%binlog%" order by file_name;
>
> +FILE_NAME	EVENT_NAME	COUNT_READ	COUNT_WRITE	SUM_NUMBER_OF_BYTES_READ	SUM_NUMBER_OF_BYTES_WRITE
> +[DATADIR]master-bin.000001	wait/io/file/sql/binlog	6	4	221	329
> +[DATADIR]master-bin.index	wait/io/file/sql/binlog_index	0	2	0	40
> +select * from performance_schema.file_summary_by_event_name
> +where event_name like "%binlog%" order by event_name;
>
> +EVENT_NAME	COUNT_READ	COUNT_WRITE	SUM_NUMBER_OF_BYTES_READ	SUM_NUMBER_OF_BYTES_WRITE
> +wait/io/file/sql/binlog	6	4	221	329
> +wait/io/file/sql/binlog_index	0	2	0	40
> +select event_name, count_star
> +from performance_schema.events_waits_summary_global_by_event_name
> +where event_name like "%MYSQL_BIN_LOG%" order by event_name;
> +event_name	count_star
> +wait/synch/cond/sql/MYSQL_BIN_LOG::COND_prep_xids	0
> +wait/synch/cond/sql/MYSQL_BIN_LOG::update_cond	1
> +wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_index	3
> +wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_prep_xids	0
> +select * from performance_schema.file_summary_by_instance
> +where event_name like "%relaylog%" order by file_name;
>
> +FILE_NAME	EVENT_NAME	COUNT_READ	COUNT_WRITE	SUM_NUMBER_OF_BYTES_READ	SUM_NUMBER_OF_BYTES_WRITE
> +select * from performance_schema.file_summary_by_event_name
> +where event_name like "%relaylog%" order by event_name;
>
> +EVENT_NAME	COUNT_READ	COUNT_WRITE	SUM_NUMBER_OF_BYTES_READ	SUM_NUMBER_OF_BYTES_WRITE
> +wait/io/file/sql/relaylog	0	0	0	0
> +wait/io/file/sql/relaylog_index	0	0	0	0
> +select * from performance_schema.events_waits_summary_global_by_event_name
> +where event_name like "%MYSQL_RELAY_LOG%" order by event_name;
> +EVENT_NAME	COUNT_STAR	SUM_TIMER_WAIT	MIN_TIMER_WAIT	AVG_TIMER_WAIT	MAX_TIMER_WAIT
> +wait/synch/cond/sql/MYSQL_RELAY_LOG::update_cond	0	0	0	0	0
> +wait/synch/mutex/sql/MYSQL_RELAY_LOG::LOCK_index	0	0	0	0	0
> +"============ Performance schema on slave ============"
> +select * from performance_schema.file_summary_by_instance
> +where file_name like "%master-%" order by file_name;
>
> +FILE_NAME	EVENT_NAME	COUNT_READ	COUNT_WRITE	SUM_NUMBER_OF_BYTES_READ	SUM_NUMBER_OF_BYTES_WRITE
> +select * from performance_schema.file_summary_by_instance
> +where file_name like "%slave-%" order by file_name;
>
> +FILE_NAME	EVENT_NAME	COUNT_READ	COUNT_WRITE	SUM_NUMBER_OF_BYTES_READ	SUM_NUMBER_OF_BYTES_WRITE
> +[DATADIR]slave-bin.000001	wait/io/file/sql/binlog	3	8	602	631
> +[DATADIR]slave-bin.index	wait/io/file/sql/binlog_index	0	3	0	57
> +[DATADIR]slave-relay-bin.000001	wait/io/file/sql/relaylog	4	3	370	263
> +[DATADIR]slave-relay-bin.000002	wait/io/file/sql/relaylog	2	4	368	368
> +[DATADIR]slave-relay-bin.index	wait/io/file/sql/relaylog_index	2	4	50	125
> +select * from performance_schema.file_summary_by_instance
> +where event_name like "%binlog%" order by file_name;
>
> +FILE_NAME	EVENT_NAME	COUNT_READ	COUNT_WRITE	SUM_NUMBER_OF_BYTES_READ	SUM_NUMBER_OF_BYTES_WRITE
> +[DATADIR]slave-bin.000001	wait/io/file/sql/binlog	3	8	602	631
> +[DATADIR]slave-bin.index	wait/io/file/sql/binlog_index	0	3	0	57
> +select * from performance_schema.file_summary_by_event_name
> +where event_name like "%binlog%" order by event_name;
>
> +EVENT_NAME	COUNT_READ	COUNT_WRITE	SUM_NUMBER_OF_BYTES_READ	SUM_NUMBER_OF_BYTES_WRITE
> +wait/io/file/sql/binlog	3	8	602	631
> +wait/io/file/sql/binlog_index	0	3	0	57
> +select event_name, count_star
> +from performance_schema.events_waits_summary_global_by_event_name
> +where event_name like "%MYSQL_BIN_LOG%" order by event_name;
> +event_name	count_star
> +wait/synch/cond/sql/MYSQL_BIN_LOG::COND_prep_xids	0
> +wait/synch/cond/sql/MYSQL_BIN_LOG::update_cond	0
> +wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_index	5
> +wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_prep_xids	0
> +select * from performance_schema.file_summary_by_instance
> +where event_name like "%relaylog%" order by file_name;
>
> +FILE_NAME	EVENT_NAME	COUNT_READ	COUNT_WRITE	SUM_NUMBER_OF_BYTES_READ	SUM_NUMBER_OF_BYTES_WRITE
> +[DATADIR]slave-relay-bin.000001	wait/io/file/sql/relaylog	4	3	370	263
> +[DATADIR]slave-relay-bin.000002	wait/io/file/sql/relaylog	2	4	368	368
> +[DATADIR]slave-relay-bin.index	wait/io/file/sql/relaylog_index	2	4	50	125
> +select * from performance_schema.file_summary_by_event_name
> +where event_name like "%relaylog%" order by event_name;
>
> +EVENT_NAME	COUNT_READ	COUNT_WRITE	SUM_NUMBER_OF_BYTES_READ	SUM_NUMBER_OF_BYTES_WRITE
> +wait/io/file/sql/relaylog	6	7	738	631
> +wait/io/file/sql/relaylog_index	2	4	50	125
> +select event_name, count_star
> +from performance_schema.events_waits_summary_global_by_event_name
> +where event_name like "%MYSQL_RELAY_LOG%" order by event_name;
> +event_name	count_star
> +wait/synch/cond/sql/MYSQL_RELAY_LOG::update_cond	2
> +wait/synch/mutex/sql/MYSQL_RELAY_LOG::LOCK_index	12
> +include/stop_slave.inc
>
> === added file 'mysql-test/suite/perfschema/t/relaylog.test'
> --- a/mysql-test/suite/perfschema/t/relaylog.test	1970-01-01 00:00:00 +0000
> +++ b/mysql-test/suite/perfschema/t/relaylog.test	2011-03-01 16:39:28 +0000
> @@ -0,0 +1,112 @@
> +# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
> +#
> +# This program is free software; you can redistribute it and/or modify
> +# it under the terms of the GNU General Public License as published by
> +# the Free Software Foundation; version 2 of the License.
> +#
> +# This program is distributed in the hope that it will be useful,
> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> +# GNU General Public License for more details.
> +#
> +# You should have received a copy of the GNU General Public License
> +# along with this program; if not, write to the Free Software Foundation,
> +# 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
> +
> +# Tests for PERFORMANCE_SCHEMA
> +
> +--source include/have_log_bin.inc
> +--source include/not_embedded.inc
> +--source include/have_perfschema.inc
> +--source include/master-slave.inc
> +
> +--disable_warnings
> +drop table if exists test.t1;
> +--sync_slave_with_master
> +reset master;
> +--enable_warnings
> +
> +create table test.t1(a int);
> +drop table test.t1;
> +
> +--source include/show_binlog_events.inc
> +
> +connection master;
> +-- echo "============ Performance schema on master ============"
> +
> +let $MYSQLD_DATADIR= `SELECT @@datadir`;
> +
> +--replace_result $MYSQLD_DATADIR [DATADIR]
> +select * from performance_schema.file_summary_by_instance
> +  where file_name like "%master-%" order by file_name;
> +
> +--replace_result $MYSQLD_DATADIR [DATADIR]
> +select * from performance_schema.file_summary_by_instance
> +  where file_name like "%slave-%" order by file_name;
> +
> +# Expect a master binlog + binlog_index

You should probably echo these so that they end up in the result file
as well.

> +
> +--replace_result $MYSQLD_DATADIR [DATADIR]
> +select * from performance_schema.file_summary_by_instance
> +  where event_name like "%binlog%" order by file_name;
> +
> +select * from performance_schema.file_summary_by_event_name
> +  where event_name like "%binlog%" order by event_name;
> +
> +select event_name, count_star
> +  from performance_schema.events_waits_summary_global_by_event_name
> +  where event_name like "%MYSQL_BIN_LOG%" order by event_name;
> +
> +# Expect no slave relay log.

Same here.

> +
> +--replace_result $MYSQLD_DATADIR [DATADIR]
> +select * from performance_schema.file_summary_by_instance
> +  where event_name like "%relaylog%" order by file_name;
> +
> +select * from performance_schema.file_summary_by_event_name
> +  where event_name like "%relaylog%" order by event_name;
> +
> +select * from performance_schema.events_waits_summary_global_by_event_name
> +  where event_name like "%MYSQL_RELAY_LOG%" order by event_name;
> +
> +sync_slave_with_master;
> +-- echo "============ Performance schema on slave ============"
> +
> +let $MYSQLD_DATADIR= `SELECT @@datadir`;
> +
> +--replace_result $MYSQLD_DATADIR [DATADIR]
> +select * from performance_schema.file_summary_by_instance
> +  where file_name like "%master-%" order by file_name;
> +
> +--replace_result $MYSQLD_DATADIR [DATADIR]
> +select * from performance_schema.file_summary_by_instance
> +  where file_name like "%slave-%" order by file_name;
> +
> +# Expect a slave binlog + binlog_index

Same here.

> +
> +--replace_result $MYSQLD_DATADIR [DATADIR]
> +select * from performance_schema.file_summary_by_instance
> +  where event_name like "%binlog%" order by file_name;
> +
> +select * from performance_schema.file_summary_by_event_name
> +  where event_name like "%binlog%" order by event_name;
> +
> +select event_name, count_star
> +  from performance_schema.events_waits_summary_global_by_event_name
> +  where event_name like "%MYSQL_BIN_LOG%" order by event_name;
> +
> +# Expect a slave relay log.

Same here.

> +
> +--replace_result $MYSQLD_DATADIR [DATADIR]
> +select * from performance_schema.file_summary_by_instance
> +  where event_name like "%relaylog%" order by file_name;
> +
> +select * from performance_schema.file_summary_by_event_name
> +  where event_name like "%relaylog%" order by event_name;
> +
> +select event_name, count_star
> +  from performance_schema.events_waits_summary_global_by_event_name
> +  where event_name like "%MYSQL_RELAY_LOG%" order by event_name;
> +
> +--source include/stop_slave.inc

Redundant, but it does not pose a problem.

Just my few cents,
Mats Kindahl

Thread
bzr commit into mysql-5.5 branch (marc.alff:3357) Bug#11766528Marc Alff1 Mar
  • Re: bzr commit into mysql-5.5 branch (marc.alff:3357) Bug#11766528Mats Kindahl9 Mar