Commit cbdc389e authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-12022 InnoDB wrongly ignores the end of an .ibd file

InnoDB can wrongly ignore the end of data files when using
innodb_page_size=32k or innodb_page_size=64k. These page sizes
use an allocation extent size of 2 or 4 megabytes, not 1 megabyte.

This issue does not affect MariaDB Server 10.2, which is using
the correct WL#5757 code from MySQL 5.7.

That said, it does not make sense to ignore the tail of data files.
The next time the data file needs to be extended, it would be extended
to a multiple of the extent size, once the size exceeds one extent.
parent 06a7923f
......@@ -692,11 +692,6 @@ fil_node_open_file(
return(false);
}
if (size_bytes >= (1024*1024)) {
/* Truncate the size to whole extent size. */
size_bytes = ut_2pow_round(size_bytes, (1024*1024));
}
if (!fsp_flags_is_compressed(flags)) {
node->size = (ulint) (size_bytes / UNIV_PAGE_SIZE);
} else {
......
......@@ -697,11 +697,6 @@ fil_node_open_file(
return(false);
}
if (size_bytes >= (1024*1024)) {
/* Truncate the size to whole extent size. */
size_bytes = ut_2pow_round(size_bytes, (1024*1024));
}
if (!fsp_flags_is_compressed(flags)) {
node->size = (ulint) (size_bytes / UNIV_PAGE_SIZE);
} else {
......
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