diff options
author | Daniel Black <daniel.black@au.ibm.com> | 2016-10-06 07:47:49 +0200 |
---|---|---|
committer | Daniel Black <daniel.black@au.ibm.com> | 2016-12-06 13:37:05 +1100 |
commit | 1e3f351e92b94a35825e2c9867c5be5e1e2d0618 (patch) | |
tree | 50f0283d9a0e22b32027847c4a54637c0fc679c0 | |
parent | 6a10681266dd39763a3dd178aee384e9f839aa28 (diff) | |
download | mariadb-git-1e3f351e92b94a35825e2c9867c5be5e1e2d0618.tar.gz |
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: Daniel Black <daniel.black@au.ibm.com>
-rw-r--r-- | storage/innobase/buf/buf0dump.cc | 10 | ||||
-rw-r--r-- | storage/xtradb/buf/buf0dump.cc | 10 |
2 files changed, 18 insertions, 2 deletions
diff --git a/storage/innobase/buf/buf0dump.cc b/storage/innobase/buf/buf0dump.cc index 682be386f2b..800fcd07435 100644 --- a/storage/innobase/buf/buf0dump.cc +++ b/storage/innobase/buf/buf0dump.cc @@ -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; diff --git a/storage/xtradb/buf/buf0dump.cc b/storage/xtradb/buf/buf0dump.cc index 114c96cec98..ee90cb76ab8 100644 --- a/storage/xtradb/buf/buf0dump.cc +++ b/storage/xtradb/buf/buf0dump.cc @@ -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; |