summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Black <daniel@mariadb.org>2022-07-25 21:00:47 +1000
committerMarko Mäkelä <marko.makela@mariadb.com>2022-07-26 15:51:11 +0300
commit552919d041c474d967701673c869edcc49081f84 (patch)
tree2e6501ee853b119c9f5d7d80aae023beadd6d06b
parentb9eb63618edcad62062f40d7dac93e18282718d5 (diff)
downloadmariadb-git-552919d041c474d967701673c869edcc49081f84.tar.gz
MDEV-29166: reduce locking of innodb rseg for user exposure of innodb_history_list_length
SHOW ENGINE INNODB STATUS and SHOW GLOBAL VARIABLES were blocking on the locks used to access the history length in MDEV-29141. While the reason for the blockage was elsewhere, we should make these monitoring commands less blocking as there is a trx_sys.history_size_approx function that can be used. SHOW ENGINE INNODB STATUS and SHOW GLOBAL STATUS LIKE 'innodb_history_list_length' and Innodb Monitors can use trx_sys.history_size_approx().
-rw-r--r--storage/innobase/lock/lock0lock.cc2
-rw-r--r--storage/innobase/srv/srv0mon.cc2
-rw-r--r--storage/innobase/srv/srv0srv.cc2
3 files changed, 3 insertions, 3 deletions
diff --git a/storage/innobase/lock/lock0lock.cc b/storage/innobase/lock/lock0lock.cc
index 9323117eff5..d5905e7b523 100644
--- a/storage/innobase/lock/lock0lock.cc
+++ b/storage/innobase/lock/lock0lock.cc
@@ -4368,7 +4368,7 @@ lock_print_info_summary(
? (purge_sys.running() ? "running"
: purge_sys.paused() ? "stopped" : "running but idle")
: "disabled",
- trx_sys.history_size());
+ trx_sys.history_size_approx());
#ifdef PRINT_NUM_OF_LOCK_STRUCTS
fprintf(file,
diff --git a/storage/innobase/srv/srv0mon.cc b/storage/innobase/srv/srv0mon.cc
index 8f6c40c2412..60fef24d183 100644
--- a/storage/innobase/srv/srv0mon.cc
+++ b/storage/innobase/srv/srv0mon.cc
@@ -1682,7 +1682,7 @@ srv_mon_process_existing_counter(
break;
case MONITOR_RSEG_HISTORY_LEN:
- value = trx_sys.history_size();
+ value = trx_sys.history_size_approx();
break;
case MONITOR_RSEG_CUR_SIZE:
diff --git a/storage/innobase/srv/srv0srv.cc b/storage/innobase/srv/srv0srv.cc
index f7526edc6f6..207984b08ed 100644
--- a/storage/innobase/srv/srv0srv.cc
+++ b/storage/innobase/srv/srv0srv.cc
@@ -1085,7 +1085,7 @@ srv_export_innodb_status(void)
- UT_LIST_GET_LEN(buf_pool.free);
export_vars.innodb_max_trx_id = trx_sys.get_max_trx_id();
- export_vars.innodb_history_list_length = trx_sys.history_size();
+ export_vars.innodb_history_list_length = trx_sys.history_size_approx();
export_vars.innodb_log_waits = srv_stats.log_waits;