Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-12022

InnoDB wrongly ignores the end of an .ibd file

    Details

      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

            Activity

              People

              • Assignee:
                marko Marko Mäkelä
                Reporter:
                marko Marko Mäkelä
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: