Commit 1b1882c6 authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-25689: Remove MONITOR_TABLE_REFERENCE, MONITOR_TABLE_CLOSE

The counter metadata_table_reference_count was not updated consistently
ever since mysql-server@65c0af9a1dedae43b63797134aff6b32304ced52
or commit 2e814d47
introduced dict_table_t::release().

The counter metadata_table_handles_closed was being incremented
unconditionally in ha_innobase::close(), while the corresponding
counter metadata_table_handles_opened would be incremented in
ha_innobase::open() if the function returned early due to an error.
parent adb0fdb2
...@@ -37,8 +37,6 @@ Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.innodb_cmpmem_reset but t ...@@ -37,8 +37,6 @@ Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.innodb_cmpmem_reset but t
select * from information_schema.innodb_metrics; select * from information_schema.innodb_metrics;
NAME SUBSYSTEM COUNT MAX_COUNT MIN_COUNT AVG_COUNT COUNT_RESET MAX_COUNT_RESET MIN_COUNT_RESET AVG_COUNT_RESET TIME_ENABLED TIME_DISABLED TIME_ELAPSED TIME_RESET ENABLED TYPE COMMENT NAME SUBSYSTEM COUNT MAX_COUNT MIN_COUNT AVG_COUNT COUNT_RESET MAX_COUNT_RESET MIN_COUNT_RESET AVG_COUNT_RESET TIME_ENABLED TIME_DISABLED TIME_ELAPSED TIME_RESET ENABLED TYPE COMMENT
metadata_table_handles_opened metadata 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of table handles opened metadata_table_handles_opened metadata 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of table handles opened
metadata_table_handles_closed metadata 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of table handles closed
metadata_table_reference_count metadata 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Table reference counter
lock_deadlocks lock 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 value Number of deadlocks lock_deadlocks lock 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 value Number of deadlocks
lock_timeouts lock 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 value Number of lock timeouts lock_timeouts lock 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 value Number of lock timeouts
lock_rec_lock_waits lock 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of times enqueued into record lock wait queue lock_rec_lock_waits lock 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of times enqueued into record lock wait queue
......
...@@ -3,8 +3,6 @@ select name, if(enabled,'enabled','disabled') status ...@@ -3,8 +3,6 @@ select name, if(enabled,'enabled','disabled') status
from information_schema.innodb_metrics; from information_schema.innodb_metrics;
name status name status
metadata_table_handles_opened disabled metadata_table_handles_opened disabled
metadata_table_handles_closed disabled
metadata_table_reference_count disabled
lock_deadlocks disabled lock_deadlocks disabled
lock_timeouts disabled lock_timeouts disabled
lock_rec_lock_waits disabled lock_rec_lock_waits disabled
...@@ -372,27 +370,9 @@ select name, max_count, min_count, count, ...@@ -372,27 +370,9 @@ select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, max_count_reset, min_count_reset, count_reset,
if(enabled,'enabled','disabled') status if(enabled,'enabled','disabled') status
from information_schema.innodb_metrics from information_schema.innodb_metrics
where name = "metadata_table_handles_opened";
name max_count min_count count max_count_reset min_count_reset count_reset status
metadata_table_handles_opened 1 NULL 1 1 NULL 1 enabled
set global innodb_monitor_enable = metadata_table_handles_closed;
create index idx on monitor_test(col);
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset,
if(enabled,'enabled','disabled') status
from information_schema.innodb_metrics
where name = "metadata_table_handles_closed";
name max_count min_count count max_count_reset min_count_reset count_reset status
metadata_table_handles_closed 1 NULL 1 1 NULL 1 enabled
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset,
if(enabled,'enabled','disabled') status
from information_schema.innodb_metrics
where name like "metadata%"; where name like "metadata%";
name max_count min_count count max_count_reset min_count_reset count_reset status name max_count min_count count max_count_reset min_count_reset count_reset status
metadata_table_handles_opened 1 NULL 1 1 NULL 1 enabled metadata_table_handles_opened 1 NULL 1 1 NULL 1 enabled
metadata_table_handles_closed 1 NULL 1 1 NULL 1 enabled
metadata_table_reference_count NULL NULL 0 NULL NULL 0 disabled
set global innodb_monitor_disable = module_metadata; set global innodb_monitor_disable = module_metadata;
set global innodb_monitor_reset = module_metadata; set global innodb_monitor_reset = module_metadata;
select name, max_count, min_count, count, select name, max_count, min_count, count,
...@@ -402,8 +382,6 @@ from information_schema.innodb_metrics ...@@ -402,8 +382,6 @@ from information_schema.innodb_metrics
where name like "metadata%"; where name like "metadata%";
name max_count min_count count max_count_reset min_count_reset count_reset status name max_count min_count count max_count_reset min_count_reset count_reset status
metadata_table_handles_opened 1 NULL 1 NULL NULL 0 disabled metadata_table_handles_opened 1 NULL 1 NULL NULL 0 disabled
metadata_table_handles_closed 1 NULL 1 NULL NULL 0 disabled
metadata_table_reference_count NULL NULL 0 NULL NULL 0 disabled
set global innodb_monitor_reset_all = module_metadata; set global innodb_monitor_reset_all = module_metadata;
select name, max_count, min_count, count, select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, max_count_reset, min_count_reset, count_reset,
...@@ -412,8 +390,6 @@ from information_schema.innodb_metrics ...@@ -412,8 +390,6 @@ from information_schema.innodb_metrics
where name like "metadata%"; where name like "metadata%";
name max_count min_count count max_count_reset min_count_reset count_reset status name max_count min_count count max_count_reset min_count_reset count_reset status
metadata_table_handles_opened NULL NULL 0 NULL NULL 0 disabled metadata_table_handles_opened NULL NULL 0 NULL NULL 0 disabled
metadata_table_handles_closed NULL NULL 0 NULL NULL 0 disabled
metadata_table_reference_count NULL NULL 0 NULL NULL 0 disabled
set global innodb_monitor_enable = module_trx; set global innodb_monitor_enable = module_trx;
begin; begin;
insert into monitor_test values(9); insert into monitor_test values(9);
...@@ -438,7 +414,7 @@ if(enabled,'enabled','disabled') status ...@@ -438,7 +414,7 @@ if(enabled,'enabled','disabled') status
from information_schema.innodb_metrics from information_schema.innodb_metrics
where name like "dml%"; where name like "dml%";
name max_count min_count count max_count_reset min_count_reset count_reset status name max_count min_count count max_count_reset min_count_reset count_reset status
dml_reads 4 NULL 4 4 NULL 4 enabled dml_reads 2 NULL 2 2 NULL 2 enabled
dml_inserts 1 NULL 1 1 NULL 1 enabled dml_inserts 1 NULL 1 1 NULL 1 enabled
dml_deletes 0 NULL 0 0 NULL 0 enabled dml_deletes 0 NULL 0 0 NULL 0 enabled
dml_updates 2 NULL 2 2 NULL 2 enabled dml_updates 2 NULL 2 2 NULL 2 enabled
...@@ -453,7 +429,7 @@ if(enabled,'enabled','disabled') status ...@@ -453,7 +429,7 @@ if(enabled,'enabled','disabled') status
from information_schema.innodb_metrics from information_schema.innodb_metrics
where name like "dml%"; where name like "dml%";
name max_count min_count count max_count_reset min_count_reset count_reset status name max_count min_count count max_count_reset min_count_reset count_reset status
dml_reads 6 NULL 6 6 NULL 6 enabled dml_reads 4 NULL 4 4 NULL 4 enabled
dml_inserts 1 NULL 1 1 NULL 1 enabled dml_inserts 1 NULL 1 1 NULL 1 enabled
dml_deletes 2 NULL 2 2 NULL 2 enabled dml_deletes 2 NULL 2 2 NULL 2 enabled
dml_updates 2 NULL 2 2 NULL 2 enabled dml_updates 2 NULL 2 2 NULL 2 enabled
...@@ -468,7 +444,7 @@ if(enabled,'enabled','disabled') status ...@@ -468,7 +444,7 @@ if(enabled,'enabled','disabled') status
from information_schema.innodb_metrics from information_schema.innodb_metrics
where name like "dml%"; where name like "dml%";
name max_count min_count count max_count_reset min_count_reset count_reset status name max_count min_count count max_count_reset min_count_reset count_reset status
dml_reads 6 NULL 6 0 NULL 0 enabled dml_reads 4 NULL 4 0 NULL 0 enabled
dml_inserts 1 NULL 1 0 NULL 0 enabled dml_inserts 1 NULL 1 0 NULL 0 enabled
dml_deletes 2 NULL 2 0 NULL 0 enabled dml_deletes 2 NULL 2 0 NULL 0 enabled
dml_updates 2 NULL 2 0 NULL 0 enabled dml_updates 2 NULL 2 0 NULL 0 enabled
...@@ -485,7 +461,7 @@ if(enabled,'enabled','disabled') status ...@@ -485,7 +461,7 @@ if(enabled,'enabled','disabled') status
from information_schema.innodb_metrics from information_schema.innodb_metrics
where name like "dml%"; where name like "dml%";
name max_count min_count count max_count_reset min_count_reset count_reset status name max_count min_count count max_count_reset min_count_reset count_reset status
dml_reads 8 NULL 8 2 NULL 2 enabled dml_reads 6 NULL 6 2 NULL 2 enabled
dml_inserts 3 NULL 3 2 NULL 2 enabled dml_inserts 3 NULL 3 2 NULL 2 enabled
dml_deletes 4 NULL 4 2 NULL 2 enabled dml_deletes 4 NULL 4 2 NULL 2 enabled
dml_updates 2 NULL 2 0 NULL 0 enabled dml_updates 2 NULL 2 0 NULL 0 enabled
...@@ -500,7 +476,7 @@ if(enabled,'enabled','disabled') status ...@@ -500,7 +476,7 @@ if(enabled,'enabled','disabled') status
from information_schema.innodb_metrics from information_schema.innodb_metrics
where name like "dml%"; where name like "dml%";
name max_count min_count count max_count_reset min_count_reset count_reset status name max_count min_count count max_count_reset min_count_reset count_reset status
dml_reads 8 NULL 8 2 NULL 2 enabled dml_reads 6 NULL 6 2 NULL 2 enabled
dml_inserts 3 NULL 3 2 NULL 2 enabled dml_inserts 3 NULL 3 2 NULL 2 enabled
dml_deletes 4 NULL 4 2 NULL 2 enabled dml_deletes 4 NULL 4 2 NULL 2 enabled
dml_updates 2 NULL 2 0 NULL 0 enabled dml_updates 2 NULL 2 0 NULL 0 enabled
...@@ -515,7 +491,7 @@ if(enabled,'enabled','disabled') status ...@@ -515,7 +491,7 @@ if(enabled,'enabled','disabled') status
from information_schema.innodb_metrics from information_schema.innodb_metrics
where name like "dml%"; where name like "dml%";
name max_count min_count count max_count_reset min_count_reset count_reset status name max_count min_count count max_count_reset min_count_reset count_reset status
dml_reads 8 NULL 8 2 NULL 2 disabled dml_reads 6 NULL 6 2 NULL 2 disabled
dml_inserts 3 NULL 3 2 NULL 2 disabled dml_inserts 3 NULL 3 2 NULL 2 disabled
dml_deletes 4 NULL 4 2 NULL 2 disabled dml_deletes 4 NULL 4 2 NULL 2 disabled
dml_updates 2 NULL 2 0 NULL 0 disabled dml_updates 2 NULL 2 0 NULL 0 disabled
......
...@@ -210,24 +210,6 @@ create table monitor_test(col int) engine = innodb stats_persistent=0; ...@@ -210,24 +210,6 @@ create table monitor_test(col int) engine = innodb stats_persistent=0;
select * from monitor_test; select * from monitor_test;
# "metadata_table_handles_opened" should increment # "metadata_table_handles_opened" should increment
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset,
if(enabled,'enabled','disabled') status
from information_schema.innodb_metrics
where name = "metadata_table_handles_opened";
# Test counter "metadata_table_handles_closed",
# create index will close the old handle
set global innodb_monitor_enable = metadata_table_handles_closed;
create index idx on monitor_test(col);
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset,
if(enabled,'enabled','disabled') status
from information_schema.innodb_metrics
where name = "metadata_table_handles_closed";
select name, max_count, min_count, count, select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, max_count_reset, min_count_reset, count_reset,
if(enabled,'enabled','disabled') status if(enabled,'enabled','disabled') status
......
...@@ -339,8 +339,6 @@ dict_table_close( ...@@ -339,8 +339,6 @@ dict_table_close(
table->stats_mutex_unlock(); table->stats_mutex_unlock();
} }
MONITOR_DEC(MONITOR_TABLE_REFERENCE);
ut_ad(dict_lru_validate()); ut_ad(dict_lru_validate());
ut_ad(dict_sys.find(table)); ut_ad(dict_sys.find(table));
...@@ -920,9 +918,8 @@ dict_table_open_on_id(table_id_t table_id, bool dict_locked, ...@@ -920,9 +918,8 @@ dict_table_open_on_id(table_id_t table_id, bool dict_locked,
: DICT_ERR_IGNORE_FK_NOKEY, : DICT_ERR_IGNORE_FK_NOKEY,
table_op == DICT_TABLE_OP_OPEN_ONLY_IF_CACHED); table_op == DICT_TABLE_OP_OPEN_ONLY_IF_CACHED);
if (table != NULL) { if (table) {
dict_sys.acquire(table); dict_sys.acquire(table);
MONITOR_INC(MONITOR_TABLE_REFERENCE);
} }
if (!dict_locked) { if (!dict_locked) {
...@@ -1147,7 +1144,6 @@ dict_table_open_on_name( ...@@ -1147,7 +1144,6 @@ dict_table_open_on_name(
} }
dict_sys.acquire(table); dict_sys.acquire(table);
MONITOR_INC(MONITOR_TABLE_REFERENCE);
} }
ut_ad(dict_lru_validate()); ut_ad(dict_lru_validate());
......
...@@ -5858,8 +5858,6 @@ ha_innobase::close() ...@@ -5858,8 +5858,6 @@ ha_innobase::close()
m_upd_buf_size = 0; m_upd_buf_size = 0;
} }
MONITOR_INC(MONITOR_TABLE_CLOSE);
DBUG_RETURN(0); DBUG_RETURN(0);
} }
......
...@@ -136,8 +136,6 @@ enum monitor_id_t { ...@@ -136,8 +136,6 @@ enum monitor_id_t {
/* Start of Metadata counter */ /* Start of Metadata counter */
MONITOR_MODULE_METADATA, MONITOR_MODULE_METADATA,
MONITOR_TABLE_OPEN, MONITOR_TABLE_OPEN,
MONITOR_TABLE_CLOSE,
MONITOR_TABLE_REFERENCE,
/* Lock manager related counters */ /* Lock manager related counters */
MONITOR_MODULE_LOCK, MONITOR_MODULE_LOCK,
......
...@@ -75,16 +75,6 @@ static monitor_info_t innodb_counter_info[] = ...@@ -75,16 +75,6 @@ static monitor_info_t innodb_counter_info[] =
MONITOR_NONE, MONITOR_NONE,
MONITOR_DEFAULT_START, MONITOR_TABLE_OPEN}, MONITOR_DEFAULT_START, MONITOR_TABLE_OPEN},
{"metadata_table_handles_closed", "metadata",
"Number of table handles closed",
MONITOR_NONE,
MONITOR_DEFAULT_START, MONITOR_TABLE_CLOSE},
{"metadata_table_reference_count", "metadata",
"Table reference counter",
MONITOR_NONE,
MONITOR_DEFAULT_START, MONITOR_TABLE_REFERENCE},
/* ========== Counters for Lock Module ========== */ /* ========== Counters for Lock Module ========== */
{"module_lock", "lock", "Lock Module", {"module_lock", "lock", "Lock Module",
MONITOR_MODULE, MONITOR_MODULE,
......
...@@ -19,8 +19,6 @@ page_size buffer_pool_instance pages_used pages_free relocation_ops relocation_t ...@@ -19,8 +19,6 @@ page_size buffer_pool_instance pages_used pages_free relocation_ops relocation_t
SELECT * FROM INFORMATION_SCHEMA.INNODB_METRICS; SELECT * FROM INFORMATION_SCHEMA.INNODB_METRICS;
NAME SUBSYSTEM COUNT MAX_COUNT MIN_COUNT AVG_COUNT COUNT_RESET MAX_COUNT_RESET MIN_COUNT_RESET AVG_COUNT_RESET TIME_ENABLED TIME_DISABLED TIME_ELAPSED TIME_RESET ENABLED TYPE COMMENT NAME SUBSYSTEM COUNT MAX_COUNT MIN_COUNT AVG_COUNT COUNT_RESET MAX_COUNT_RESET MIN_COUNT_RESET AVG_COUNT_RESET TIME_ENABLED TIME_DISABLED TIME_ELAPSED TIME_RESET ENABLED TYPE COMMENT
metadata_table_handles_opened metadata 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of table handles opened metadata_table_handles_opened metadata 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of table handles opened
metadata_table_handles_closed metadata 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of table handles closed
metadata_table_reference_count metadata 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Table reference counter
lock_deadlocks lock 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 value Number of deadlocks lock_deadlocks lock 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 value Number of deadlocks
lock_timeouts lock 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 value Number of lock timeouts lock_timeouts lock 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 value Number of lock timeouts
lock_rec_lock_waits lock 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of times enqueued into record lock wait queue lock_rec_lock_waits lock 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of times enqueued into record lock wait queue
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment