Skip to content

Commit

Permalink
MDEV-31309 Innodb_buffer_pool_read_requests is not updated correctly
Browse files Browse the repository at this point in the history
srv_export_innodb_status(): Update
export_vars.innodb_buffer_pool_read_requests as it was done
before commit a55b951 (MDEV-26827).
If innodb_status_variables[] pointed to a sharded variable, it would
only access the first shard.
  • Loading branch information
dr-m authored and vuvova committed Jun 3, 2023
1 parent 89eb6fa commit dd29887
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion storage/innobase/handler/ha_innodb.cc
Expand Up @@ -946,7 +946,8 @@ static SHOW_VAR innodb_status_variables[]= {
{"buffer_pool_read_ahead", &buf_pool.stat.n_ra_pages_read, SHOW_SIZE_T},
{"buffer_pool_read_ahead_evicted",
&buf_pool.stat.n_ra_pages_evicted, SHOW_SIZE_T},
{"buffer_pool_read_requests", &buf_pool.stat.n_page_gets, SHOW_SIZE_T},
{"buffer_pool_read_requests",
&export_vars.innodb_buffer_pool_read_requests, SHOW_SIZE_T},
{"buffer_pool_reads", &buf_pool.stat.n_pages_read, SHOW_SIZE_T},
{"buffer_pool_wait_free", &buf_pool.stat.LRU_waits, SHOW_SIZE_T},
{"buffer_pool_write_requests",
Expand Down
2 changes: 2 additions & 0 deletions storage/innobase/include/srv0srv.h
Expand Up @@ -674,6 +674,8 @@ struct export_var_t{
#ifdef UNIV_DEBUG
ulint innodb_buffer_pool_pages_latched; /*!< Latched pages */
#endif /* UNIV_DEBUG */
/** buf_pool.stat.n_page_gets (a sharded counter) */
ulint innodb_buffer_pool_read_requests;
ulint innodb_buffer_pool_write_requests;/*!< srv_stats.buf_pool_write_requests */
ulint innodb_checkpoint_age;
ulint innodb_checkpoint_max_age;
Expand Down
3 changes: 3 additions & 0 deletions storage/innobase/srv/srv0srv.cc
Expand Up @@ -1011,6 +1011,9 @@ srv_export_innodb_status(void)
export_vars.innodb_data_written = srv_stats.data_written
+ (dblwr << srv_page_size_shift);

export_vars.innodb_buffer_pool_read_requests
= buf_pool.stat.n_page_gets;

export_vars.innodb_buffer_pool_write_requests =
srv_stats.buf_pool_write_requests;

Expand Down

0 comments on commit dd29887

Please sign in to comment.