Commit 552919d0 authored by Daniel Black's avatar Daniel Black Committed by Marko Mäkelä

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().
parent b9eb6361
...@@ -4368,7 +4368,7 @@ lock_print_info_summary( ...@@ -4368,7 +4368,7 @@ lock_print_info_summary(
? (purge_sys.running() ? "running" ? (purge_sys.running() ? "running"
: purge_sys.paused() ? "stopped" : "running but idle") : purge_sys.paused() ? "stopped" : "running but idle")
: "disabled", : "disabled",
trx_sys.history_size()); trx_sys.history_size_approx());
#ifdef PRINT_NUM_OF_LOCK_STRUCTS #ifdef PRINT_NUM_OF_LOCK_STRUCTS
fprintf(file, fprintf(file,
......
...@@ -1682,7 +1682,7 @@ srv_mon_process_existing_counter( ...@@ -1682,7 +1682,7 @@ srv_mon_process_existing_counter(
break; break;
case MONITOR_RSEG_HISTORY_LEN: case MONITOR_RSEG_HISTORY_LEN:
value = trx_sys.history_size(); value = trx_sys.history_size_approx();
break; break;
case MONITOR_RSEG_CUR_SIZE: case MONITOR_RSEG_CUR_SIZE:
......
...@@ -1085,7 +1085,7 @@ srv_export_innodb_status(void) ...@@ -1085,7 +1085,7 @@ srv_export_innodb_status(void)
- UT_LIST_GET_LEN(buf_pool.free); - UT_LIST_GET_LEN(buf_pool.free);
export_vars.innodb_max_trx_id = trx_sys.get_max_trx_id(); 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; export_vars.innodb_log_waits = srv_stats.log_waits;
......
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