summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2021-05-17 09:56:04 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2021-05-17 09:56:04 +0300
commit1b1882c6270ad9648502c4267ace3d40fff1ccfc (patch)
tree4bded9d4b4937bd42a72ed10b58392182c7ff978
parentadb0fdb268c6b461a130c27f53a5244a3aa217e9 (diff)
downloadmariadb-git-1b1882c6270ad9648502c4267ace3d40fff1ccfc.tar.gz
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 2e814d4702d71a04388386a9f591d14a35980bfe 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.
-rw-r--r--mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result2
-rw-r--r--mysql-test/suite/innodb/r/monitor.result36
-rw-r--r--mysql-test/suite/innodb/t/monitor.test18
-rw-r--r--storage/innobase/dict/dict0dict.cc6
-rw-r--r--storage/innobase/handler/ha_innodb.cc2
-rw-r--r--storage/innobase/include/srv0mon.h2
-rw-r--r--storage/innobase/srv/srv0mon.cc10
-rw-r--r--storage/rocksdb/mysql-test/rocksdb/r/innodb_i_s_tables_disabled.result2
8 files changed, 7 insertions, 71 deletions
diff --git a/mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result b/mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result
index 9e87ee53f35..1f3b0750e56 100644
--- a/mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result
+++ b/mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result
@@ -37,8 +37,6 @@ Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.innodb_cmpmem_reset but t
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
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_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
diff --git a/mysql-test/suite/innodb/r/monitor.result b/mysql-test/suite/innodb/r/monitor.result
index b6883250128..767ed7edcc5 100644
--- a/mysql-test/suite/innodb/r/monitor.result
+++ b/mysql-test/suite/innodb/r/monitor.result
@@ -3,8 +3,6 @@ select name, if(enabled,'enabled','disabled') status
from information_schema.innodb_metrics;
name status
metadata_table_handles_opened disabled
-metadata_table_handles_closed disabled
-metadata_table_reference_count disabled
lock_deadlocks disabled
lock_timeouts disabled
lock_rec_lock_waits disabled
@@ -372,27 +370,9 @@ 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";
-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%";
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_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_reset = module_metadata;
select name, max_count, min_count, count,
@@ -402,8 +382,6 @@ from information_schema.innodb_metrics
where name like "metadata%";
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_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;
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset,
@@ -412,8 +390,6 @@ from information_schema.innodb_metrics
where name like "metadata%";
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_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;
begin;
insert into monitor_test values(9);
@@ -438,7 +414,7 @@ if(enabled,'enabled','disabled') status
from information_schema.innodb_metrics
where name like "dml%";
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_deletes 0 NULL 0 0 NULL 0 enabled
dml_updates 2 NULL 2 2 NULL 2 enabled
@@ -453,7 +429,7 @@ if(enabled,'enabled','disabled') status
from information_schema.innodb_metrics
where name like "dml%";
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_deletes 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
from information_schema.innodb_metrics
where name like "dml%";
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_deletes 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
from information_schema.innodb_metrics
where name like "dml%";
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_deletes 4 NULL 4 2 NULL 2 enabled
dml_updates 2 NULL 2 0 NULL 0 enabled
@@ -500,7 +476,7 @@ if(enabled,'enabled','disabled') status
from information_schema.innodb_metrics
where name like "dml%";
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_deletes 4 NULL 4 2 NULL 2 enabled
dml_updates 2 NULL 2 0 NULL 0 enabled
@@ -515,7 +491,7 @@ if(enabled,'enabled','disabled') status
from information_schema.innodb_metrics
where name like "dml%";
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_deletes 4 NULL 4 2 NULL 2 disabled
dml_updates 2 NULL 2 0 NULL 0 disabled
diff --git a/mysql-test/suite/innodb/t/monitor.test b/mysql-test/suite/innodb/t/monitor.test
index 38ff520aeae..b80d9deabc1 100644
--- a/mysql-test/suite/innodb/t/monitor.test
+++ b/mysql-test/suite/innodb/t/monitor.test
@@ -214,24 +214,6 @@ 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,
- max_count_reset, min_count_reset, count_reset,
- if(enabled,'enabled','disabled') status
-from information_schema.innodb_metrics
where name like "metadata%";
# Reset counters only in "module_metadata" module
diff --git a/storage/innobase/dict/dict0dict.cc b/storage/innobase/dict/dict0dict.cc
index 0f44e2a9c23..be43f56320b 100644
--- a/storage/innobase/dict/dict0dict.cc
+++ b/storage/innobase/dict/dict0dict.cc
@@ -339,8 +339,6 @@ dict_table_close(
table->stats_mutex_unlock();
}
- MONITOR_DEC(MONITOR_TABLE_REFERENCE);
-
ut_ad(dict_lru_validate());
ut_ad(dict_sys.find(table));
@@ -920,9 +918,8 @@ dict_table_open_on_id(table_id_t table_id, bool dict_locked,
: DICT_ERR_IGNORE_FK_NOKEY,
table_op == DICT_TABLE_OP_OPEN_ONLY_IF_CACHED);
- if (table != NULL) {
+ if (table) {
dict_sys.acquire(table);
- MONITOR_INC(MONITOR_TABLE_REFERENCE);
}
if (!dict_locked) {
@@ -1147,7 +1144,6 @@ dict_table_open_on_name(
}
dict_sys.acquire(table);
- MONITOR_INC(MONITOR_TABLE_REFERENCE);
}
ut_ad(dict_lru_validate());
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index 5b5f07e3ce2..97665da2f1a 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -5858,8 +5858,6 @@ ha_innobase::close()
m_upd_buf_size = 0;
}
- MONITOR_INC(MONITOR_TABLE_CLOSE);
-
DBUG_RETURN(0);
}
diff --git a/storage/innobase/include/srv0mon.h b/storage/innobase/include/srv0mon.h
index 3faf4f7b7b0..533838658b4 100644
--- a/storage/innobase/include/srv0mon.h
+++ b/storage/innobase/include/srv0mon.h
@@ -136,8 +136,6 @@ enum monitor_id_t {
/* Start of Metadata counter */
MONITOR_MODULE_METADATA,
MONITOR_TABLE_OPEN,
- MONITOR_TABLE_CLOSE,
- MONITOR_TABLE_REFERENCE,
/* Lock manager related counters */
MONITOR_MODULE_LOCK,
diff --git a/storage/innobase/srv/srv0mon.cc b/storage/innobase/srv/srv0mon.cc
index 3a0338a0f71..eea86c2cae6 100644
--- a/storage/innobase/srv/srv0mon.cc
+++ b/storage/innobase/srv/srv0mon.cc
@@ -75,16 +75,6 @@ static monitor_info_t innodb_counter_info[] =
MONITOR_NONE,
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 ========== */
{"module_lock", "lock", "Lock Module",
MONITOR_MODULE,
diff --git a/storage/rocksdb/mysql-test/rocksdb/r/innodb_i_s_tables_disabled.result b/storage/rocksdb/mysql-test/rocksdb/r/innodb_i_s_tables_disabled.result
index 5afb59327a9..7cedb9283a6 100644
--- a/storage/rocksdb/mysql-test/rocksdb/r/innodb_i_s_tables_disabled.result
+++ b/storage/rocksdb/mysql-test/rocksdb/r/innodb_i_s_tables_disabled.result
@@ -19,8 +19,6 @@ page_size buffer_pool_instance pages_used pages_free relocation_ops relocation_t
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
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_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