Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PS-7144 : incorrect number of doublewrite files created if innodb_buffer_pool_size > 1G #4

Open
wants to merge 1 commit into
base: ps-8.0.20-merge
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions mysql-test/suite/innodb/r/dblwr_file_count.result
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#
# PS-7144 : incorrect number of doublewrite files created if innodb_buffer_pool_size > 1G
#
1 change: 1 addition & 0 deletions mysql-test/suite/innodb/t/dblwr_file_count-master.opt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--innodb_buffer_pool_size=1G
22 changes: 22 additions & 0 deletions mysql-test/suite/innodb/t/dblwr_file_count.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Test needs 1G min buffer pool size
--source include/big_test.inc

--echo #
--echo # PS-7144 : incorrect number of doublewrite files created if innodb_buffer_pool_size > 1G
--echo #

--let $MYSQLD_DATADIR=`SELECT @@datadir`
--let $PAGE_SIZE=`SELECT @@innodb_page_size`

--let $max = `SELECT @@innodb_buffer_pool_instances * 2`
--let $i = 0

while ($i < $max) {
--let $part1=$MYSQLD_DATADIR/#ib_$PAGE_SIZE
--let $part2=_$i.dblwr
--let $file= $part1$part2

--file_exists $file

--inc $i
}
6 changes: 4 additions & 2 deletions storage/innobase/buf/buf0dblwr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1746,7 +1746,9 @@ dberr_t dblwr::open(bool create_new_db) noexcept {
uint32_t segments_per_file{};

if (dblwr::n_files == 0) {
dblwr::n_files = 2;
dblwr::n_files = std::max(2UL, srv_buf_pool_instances * 2);
} else if (dblwr::n_files > srv_buf_pool_instances * 2) {
dblwr::n_files = srv_buf_pool_instances * 2;
}

ib::info(ER_IB_MSG_DBLWR_1324)
Expand All @@ -1759,7 +1761,7 @@ dberr_t dblwr::open(bool create_new_db) noexcept {
ib::info(ER_IB_MSG_DBLWR_1323)
<< "Double write buffer pages per instance: " << dblwr::n_pages;

if (Double_write::s_n_instances < dblwr::n_files) {
if (Double_write::s_n_instances <= dblwr::n_files) {
segments_per_file = 1;
Double_write::s_files.resize(Double_write::s_n_instances);
} else {
Expand Down