mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge 5.5
This commit is contained in:
169
mysql-test/suite/perfschema/r/relaylog.result
Normal file
169
mysql-test/suite/perfschema/r/relaylog.result
Normal file
@ -0,0 +1,169 @@
|
||||
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
|
||||
substring(file_name, locate("master-", file_name)) as FILE_NAME,
|
||||
EVENT_NAME,
|
||||
if (count_read > 0, "MANY", "NONE") as COUNT_READ,
|
||||
if (count_write > 0,"MANY", "NONE") as COUNT_WRITE,
|
||||
if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ,
|
||||
if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE
|
||||
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
|
||||
master-bin.000001 wait/io/file/sql/binlog MANY MANY MANY MANY
|
||||
master-bin.index wait/io/file/sql/binlog_index NONE MANY NONE MANY
|
||||
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
|
||||
"Expect a master binlog + binlog_index"
|
||||
select
|
||||
substring(file_name, locate("master-", file_name)) as FILE_NAME,
|
||||
EVENT_NAME,
|
||||
if (count_read > 0, "MANY", "NONE") as COUNT_READ,
|
||||
if (count_write > 0,"MANY", "NONE") as COUNT_WRITE,
|
||||
if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ,
|
||||
if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE
|
||||
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
|
||||
master-bin.000001 wait/io/file/sql/binlog MANY MANY MANY MANY
|
||||
master-bin.index wait/io/file/sql/binlog_index NONE MANY NONE MANY
|
||||
select
|
||||
EVENT_NAME,
|
||||
if (count_read > 0, "MANY", "NONE") as COUNT_READ,
|
||||
if (count_write > 0,"MANY", "NONE") as COUNT_WRITE,
|
||||
if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ,
|
||||
if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE
|
||||
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 MANY MANY MANY MANY
|
||||
wait/io/file/sql/binlog_index NONE MANY NONE MANY
|
||||
select
|
||||
EVENT_NAME,
|
||||
if (count_star > 0, "MANY", "NONE") as 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 NONE
|
||||
wait/synch/cond/sql/MYSQL_BIN_LOG::update_cond MANY
|
||||
wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_index MANY
|
||||
wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_prep_xids NONE
|
||||
"Expect no slave relay log"
|
||||
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
|
||||
substring(file_name, locate("slave-", file_name)) as FILE_NAME,
|
||||
EVENT_NAME,
|
||||
if (count_read > 0, "MANY", "NONE") as COUNT_READ,
|
||||
if (count_write > 0,"MANY", "NONE") as COUNT_WRITE,
|
||||
if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ,
|
||||
if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE
|
||||
from performance_schema.file_summary_by_instance
|
||||
where file_name like "%slave-%"
|
||||
and (file_name not like "%slave-relay-bin.0%"
|
||||
or file_name like "%slave-relay-bin.000001"
|
||||
or file_name like "%slave-relay-bin.000002")
|
||||
order by file_name;
|
||||
FILE_NAME EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE
|
||||
slave-bin.000001 wait/io/file/sql/binlog MANY MANY MANY MANY
|
||||
slave-bin.index wait/io/file/sql/binlog_index NONE MANY NONE MANY
|
||||
slave-relay-bin.000001 wait/io/file/sql/relaylog MANY MANY MANY MANY
|
||||
slave-relay-bin.000002 wait/io/file/sql/relaylog MANY MANY MANY MANY
|
||||
slave-relay-bin.index wait/io/file/sql/relaylog_index MANY MANY MANY MANY
|
||||
"Expect a slave binlog + binlog_index"
|
||||
select
|
||||
substring(file_name, locate("slave-", file_name)) as FILE_NAME,
|
||||
EVENT_NAME,
|
||||
if (count_read > 0, "MANY", "NONE") as COUNT_READ,
|
||||
if (count_write > 0,"MANY", "NONE") as COUNT_WRITE,
|
||||
if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ,
|
||||
if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE
|
||||
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
|
||||
slave-bin.000001 wait/io/file/sql/binlog MANY MANY MANY MANY
|
||||
slave-bin.index wait/io/file/sql/binlog_index NONE MANY NONE MANY
|
||||
select
|
||||
EVENT_NAME,
|
||||
if (count_read > 0, "MANY", "NONE") as COUNT_READ,
|
||||
if (count_write > 0,"MANY", "NONE") as COUNT_WRITE,
|
||||
if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ,
|
||||
if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE
|
||||
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 MANY MANY MANY MANY
|
||||
wait/io/file/sql/binlog_index NONE MANY NONE MANY
|
||||
select
|
||||
EVENT_NAME,
|
||||
if (count_star > 0, "MANY", "NONE") as 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 NONE
|
||||
wait/synch/cond/sql/MYSQL_BIN_LOG::update_cond NONE
|
||||
wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_index MANY
|
||||
wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_prep_xids NONE
|
||||
"Expect a slave relay log"
|
||||
select
|
||||
substring(file_name, locate("slave-", file_name)) as FILE_NAME,
|
||||
EVENT_NAME,
|
||||
if (count_read > 0, "MANY", "NONE") as COUNT_READ,
|
||||
if (count_write > 0,"MANY", "NONE") as COUNT_WRITE,
|
||||
if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ,
|
||||
if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE
|
||||
from performance_schema.file_summary_by_instance
|
||||
where event_name like "%relaylog%"
|
||||
and (file_name not like "%slave-relay-bin.0%"
|
||||
or file_name like "%slave-relay-bin.000001"
|
||||
or file_name like "%slave-relay-bin.000002")
|
||||
order by file_name;
|
||||
FILE_NAME EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE
|
||||
slave-relay-bin.000001 wait/io/file/sql/relaylog MANY MANY MANY MANY
|
||||
slave-relay-bin.000002 wait/io/file/sql/relaylog MANY MANY MANY MANY
|
||||
slave-relay-bin.index wait/io/file/sql/relaylog_index MANY MANY MANY MANY
|
||||
select
|
||||
EVENT_NAME,
|
||||
if (count_read > 0, "MANY", "NONE") as COUNT_READ,
|
||||
if (count_write > 0,"MANY", "NONE") as COUNT_WRITE,
|
||||
if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ,
|
||||
if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE
|
||||
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 MANY MANY MANY MANY
|
||||
wait/io/file/sql/relaylog_index MANY MANY MANY MANY
|
||||
select
|
||||
EVENT_NAME,
|
||||
if (count_star > 0, "MANY", "NONE") as 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 MANY
|
||||
wait/synch/mutex/sql/MYSQL_RELAY_LOG::LOCK_index MANY
|
||||
include/stop_slave.inc
|
179
mysql-test/suite/perfschema/t/relaylog.test
Normal file
179
mysql-test/suite/perfschema/t/relaylog.test
Normal file
@ -0,0 +1,179 @@
|
||||
# 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
|
||||
|
||||
# Notes
|
||||
#
|
||||
# The point of this test is to make sure code is properly instrumented,
|
||||
# where instruments have the proper key (binlog or relaylog),
|
||||
# it is not to dive into statistics for each instruments.
|
||||
# Different test execution sequence in different platforms do make the
|
||||
# results vary, making the test results very sensitive to changes.
|
||||
# To ensure robustness:
|
||||
# - log file rotation is limited to file .000001 and .000002
|
||||
# - statistics are normalized to "NONE" or "MANY"
|
||||
#
|
||||
|
||||
connection master;
|
||||
-- echo "============ Performance schema on master ============"
|
||||
|
||||
select
|
||||
substring(file_name, locate("master-", file_name)) as FILE_NAME,
|
||||
EVENT_NAME,
|
||||
if (count_read > 0, "MANY", "NONE") as COUNT_READ,
|
||||
if (count_write > 0,"MANY", "NONE") as COUNT_WRITE,
|
||||
if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ,
|
||||
if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE
|
||||
from performance_schema.file_summary_by_instance
|
||||
where file_name like "%master-%" order by file_name;
|
||||
|
||||
select * from performance_schema.file_summary_by_instance
|
||||
where file_name like "%slave-%" order by file_name;
|
||||
|
||||
-- echo "Expect a master binlog + binlog_index"
|
||||
|
||||
select
|
||||
substring(file_name, locate("master-", file_name)) as FILE_NAME,
|
||||
EVENT_NAME,
|
||||
if (count_read > 0, "MANY", "NONE") as COUNT_READ,
|
||||
if (count_write > 0,"MANY", "NONE") as COUNT_WRITE,
|
||||
if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ,
|
||||
if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE
|
||||
from performance_schema.file_summary_by_instance
|
||||
where event_name like "%binlog%" order by file_name;
|
||||
|
||||
select
|
||||
EVENT_NAME,
|
||||
if (count_read > 0, "MANY", "NONE") as COUNT_READ,
|
||||
if (count_write > 0,"MANY", "NONE") as COUNT_WRITE,
|
||||
if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ,
|
||||
if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE
|
||||
from performance_schema.file_summary_by_event_name
|
||||
where event_name like "%binlog%" order by event_name;
|
||||
|
||||
select
|
||||
EVENT_NAME,
|
||||
if (count_star > 0, "MANY", "NONE") as COUNT_STAR
|
||||
from performance_schema.events_waits_summary_global_by_event_name
|
||||
where event_name like "%MYSQL_BIN_LOG%" order by event_name;
|
||||
|
||||
-- echo "Expect no slave relay log"
|
||||
|
||||
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 ============"
|
||||
|
||||
select * from performance_schema.file_summary_by_instance
|
||||
where file_name like "%master-%" order by file_name;
|
||||
|
||||
select
|
||||
substring(file_name, locate("slave-", file_name)) as FILE_NAME,
|
||||
EVENT_NAME,
|
||||
if (count_read > 0, "MANY", "NONE") as COUNT_READ,
|
||||
if (count_write > 0,"MANY", "NONE") as COUNT_WRITE,
|
||||
if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ,
|
||||
if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE
|
||||
from performance_schema.file_summary_by_instance
|
||||
where file_name like "%slave-%"
|
||||
and (file_name not like "%slave-relay-bin.0%"
|
||||
or file_name like "%slave-relay-bin.000001"
|
||||
or file_name like "%slave-relay-bin.000002")
|
||||
order by file_name;
|
||||
|
||||
-- echo "Expect a slave binlog + binlog_index"
|
||||
|
||||
select
|
||||
substring(file_name, locate("slave-", file_name)) as FILE_NAME,
|
||||
EVENT_NAME,
|
||||
if (count_read > 0, "MANY", "NONE") as COUNT_READ,
|
||||
if (count_write > 0,"MANY", "NONE") as COUNT_WRITE,
|
||||
if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ,
|
||||
if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE
|
||||
from performance_schema.file_summary_by_instance
|
||||
where event_name like "%binlog%" order by file_name;
|
||||
|
||||
select
|
||||
EVENT_NAME,
|
||||
if (count_read > 0, "MANY", "NONE") as COUNT_READ,
|
||||
if (count_write > 0,"MANY", "NONE") as COUNT_WRITE,
|
||||
if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ,
|
||||
if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE
|
||||
from performance_schema.file_summary_by_event_name
|
||||
where event_name like "%binlog%" order by event_name;
|
||||
|
||||
select
|
||||
EVENT_NAME,
|
||||
if (count_star > 0, "MANY", "NONE") as COUNT_STAR
|
||||
from performance_schema.events_waits_summary_global_by_event_name
|
||||
where event_name like "%MYSQL_BIN_LOG%" order by event_name;
|
||||
|
||||
-- echo "Expect a slave relay log"
|
||||
|
||||
select
|
||||
substring(file_name, locate("slave-", file_name)) as FILE_NAME,
|
||||
EVENT_NAME,
|
||||
if (count_read > 0, "MANY", "NONE") as COUNT_READ,
|
||||
if (count_write > 0,"MANY", "NONE") as COUNT_WRITE,
|
||||
if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ,
|
||||
if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE
|
||||
from performance_schema.file_summary_by_instance
|
||||
where event_name like "%relaylog%"
|
||||
and (file_name not like "%slave-relay-bin.0%"
|
||||
or file_name like "%slave-relay-bin.000001"
|
||||
or file_name like "%slave-relay-bin.000002")
|
||||
order by file_name;
|
||||
|
||||
select
|
||||
EVENT_NAME,
|
||||
if (count_read > 0, "MANY", "NONE") as COUNT_READ,
|
||||
if (count_write > 0,"MANY", "NONE") as COUNT_WRITE,
|
||||
if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ,
|
||||
if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE
|
||||
from performance_schema.file_summary_by_event_name
|
||||
where event_name like "%relaylog%" order by event_name;
|
||||
|
||||
select
|
||||
EVENT_NAME,
|
||||
if (count_star > 0, "MANY", "NONE") as 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
|
||||
|
Reference in New Issue
Block a user