Skip to content

Commit 32170ca

Browse files
committed
MDEV-12075 innodb_use_fallocate does not work in MariaDB Server 10.1.21
fil_space_extend_must_retry(): When innodb_use_fallocate=ON, initialize pages_added = size - space->size so that posix_fallocate() will actually attempt to extend the file, instead of keeping the same size. This is a regression from MDEV-11556 which refactored the InnoDB data file extension.
1 parent 74a5638 commit 32170ca

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

storage/innobase/fil/fil0fil.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1054,6 +1054,8 @@ fil_space_extend_must_retry(
10541054
? OS_FILE_READ : OS_FILE_WRITE;
10551055

10561056
if (srv_use_posix_fallocate) {
1057+
pages_added = size - space->size;
1058+
10571059
const os_offset_t start_offset = static_cast<os_offset_t>(
10581060
start_page_no) * page_size;
10591061
const os_offset_t len = static_cast<os_offset_t>(

storage/xtradb/fil/fil0fil.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1059,6 +1059,8 @@ fil_space_extend_must_retry(
10591059
? OS_FILE_READ : OS_FILE_WRITE;
10601060

10611061
if (srv_use_posix_fallocate) {
1062+
pages_added = size - space->size;
1063+
10621064
const os_offset_t start_offset = static_cast<os_offset_t>(
10631065
start_page_no) * page_size;
10641066
const os_offset_t len = static_cast<os_offset_t>(

0 commit comments

Comments
 (0)