Skip to content

Commit

Permalink
MDEV-29166: reduce locking of innodb rseg for user exposure of innodb…
Browse files Browse the repository at this point in the history
…_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().
  • Loading branch information
grooverdan authored and dr-m committed Jul 26, 2022
1 parent b9eb636 commit 552919d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion storage/innobase/lock/lock0lock.cc
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion storage/innobase/srv/srv0mon.cc
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion storage/innobase/srv/srv0srv.cc
Expand Up @@ -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;

Expand Down

0 comments on commit 552919d

Please sign in to comment.