Commit 32170caf authored by Marko Mäkelä's avatar Marko Mäkelä

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.
parent 74a5638a
...@@ -1054,6 +1054,8 @@ fil_space_extend_must_retry( ...@@ -1054,6 +1054,8 @@ fil_space_extend_must_retry(
? OS_FILE_READ : OS_FILE_WRITE; ? OS_FILE_READ : OS_FILE_WRITE;
if (srv_use_posix_fallocate) { if (srv_use_posix_fallocate) {
pages_added = size - space->size;
const os_offset_t start_offset = static_cast<os_offset_t>( const os_offset_t start_offset = static_cast<os_offset_t>(
start_page_no) * page_size; start_page_no) * page_size;
const os_offset_t len = static_cast<os_offset_t>( const os_offset_t len = static_cast<os_offset_t>(
......
...@@ -1059,6 +1059,8 @@ fil_space_extend_must_retry( ...@@ -1059,6 +1059,8 @@ fil_space_extend_must_retry(
? OS_FILE_READ : OS_FILE_WRITE; ? OS_FILE_READ : OS_FILE_WRITE;
if (srv_use_posix_fallocate) { if (srv_use_posix_fallocate) {
pages_added = size - space->size;
const os_offset_t start_offset = static_cast<os_offset_t>( const os_offset_t start_offset = static_cast<os_offset_t>(
start_page_no) * page_size; start_page_no) * page_size;
const os_offset_t len = static_cast<os_offset_t>( const os_offset_t len = static_cast<os_offset_t>(
......
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