Commit 1e3f351e authored by Daniel Black's avatar Daniel Black

MDEV-11454: Make innodb_buffer_pool_dump_pct refer to the entire buffer pool size

Rather than innodb_buffer_pool_dump_pct referring to the percentage of hot data
in the buffer pool, it refers to the entire buffer pool size. This means that a
completed load followed by a shutdown will write the exact same data.

The problem was:

With innodb_buffer_pool_dump_pct say 25% (the default since 10.2.2), a server
started will restore 25% of the buffer pool size with the expectation that over
time the rest of the buffer pool will be populated. Then on shutdown 25% will
be saved.

If a server is started and then is shutdown a) without much activity occurring
b) is started as a hot spare and shutdown before being used, then 6.25% (25%
of 25%) of the buffer pool is saved.

This will generate bigger dump files for users who don't have a full
innodb_buffer_pool however a realistic scenario is a buffer pool should be
completely used.
Signed-off-by: default avatarDaniel Black <daniel.black@au.ibm.com>
parent 6a106812
......@@ -313,9 +313,17 @@ buf_dump(
}
if (srv_buf_pool_dump_pct != 100) {
ulint t_pages;
ut_ad(srv_buf_pool_dump_pct < 100);
n_pages = n_pages * srv_buf_pool_dump_pct / 100;
/* limit the number of total pages dumped to X% of the
* total number of pages */
t_pages = buf_pool->curr_size
* srv_buf_pool_dump_pct / 100;
if (n_pages > t_pages) {
n_pages = t_pages;
}
if (n_pages == 0) {
n_pages = 1;
......
......@@ -248,9 +248,17 @@ buf_dump(
}
if (srv_buf_pool_dump_pct != 100) {
ulint t_pages;
ut_ad(srv_buf_pool_dump_pct < 100);
n_pages = n_pages * srv_buf_pool_dump_pct / 100;
/* limit the number of total pages dumped to X% of the
* total number of pages */
t_pages = buf_pool->curr_size
* srv_buf_pool_dump_pct / 100;
if (n_pages > t_pages) {
n_pages = t_pages;
}
if (n_pages == 0) {
n_pages = 1;
......
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