Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.1.21
-
None
Description
The test innodb.innodb-64k-crash is crashing in recovery due to a wrongly reported out-of-bounds page access:
2017-02-08 10:45:40 140342763513024 [Note] InnoDB: Waiting for purge to start
|
InnoDB: Error: trying to access page number 2 in space 5,
|
InnoDB: space name test/t2,
|
InnoDB: which is outside the tablespace bounds.
|
The tablespace file in question has FSP_SIZE=21 which corresponds to the file size 21*16384 pages. The error message above is misleading, because it is not really about accessing page 2, but accessing page space->size+2. The issue is that InnoDB wrongly truncated the space->size to 16. The fix is to remove that bogus truncation:
diff --git a/storage/innobase/fil/fil0fil.cc b/storage/innobase/fil/fil0fil.cc
|
index 97e70645636..949907af597 100644
|
--- a/storage/innobase/fil/fil0fil.cc
|
+++ b/storage/innobase/fil/fil0fil.cc
|
@@ -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 { |
Attachments
Issue Links
- duplicates
-
MDEV-11792 InnoDB: Error: trying to access page number 0 in space 5, Assertion failure in file fil0fil.cc line 6109
-
- Closed
-
- relates to
-
MDEV-11556 InnoDB redo log apply fails to adjust data file sizes
-
- Closed
-
Note: In MySQL 5.7 (which was the first MySQL version to support innodb_page_size=32k or innodb_page_size=64k, in WL#5757) the extent size is 2 MiB for innodb_page_size=32k and 4 MiB for innodb_page_size=64k. See for example dict_table_extent_size() and the macro definition:
#define FSP_EXTENT_SIZE ((UNIV_PAGE_SIZE <= (16384) ? \
(1048576 / UNIV_PAGE_SIZE) : \
((UNIV_PAGE_SIZE <= (32768)) ? \
(2097152 / UNIV_PAGE_SIZE) : \
(4194304 / UNIV_PAGE_SIZE))))
That said, I do not see any point in ignoring the end of the file when opening a file.
MDEV-11556already made file size extension crash-safe.