MDEV-31309 Innodb_buffer_pool_read_requests is not updated correctly

srv_export_innodb_status(): Update
export_vars.innodb_buffer_pool_read_requests as it was done
before commit a55b951e60 (MDEV-26827).
If innodb_status_variables[] pointed to a sharded variable, it would
only access the first shard.
This commit is contained in:
Marko Mäkelä 2023-05-19 15:38:48 +03:00 committed by Sergei Golubchik
parent 89eb6fa8a7
commit dd298873da
3 changed files with 7 additions and 1 deletions

View file

@ -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",

View file

@ -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;

View file

@ -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;