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

InnoDB fails to refuse startup when a file is not found in crash recovery

    Details

      Description

      I originally reported this in MDEV-12905.
      In the test innodb.log_file_name, the startup attempt "Fault 2" sometimes fails to refuse InnoDB startup, even though the file t3.ibd is reported not to be found.
      Because --innodb-force-recovery was not specified, this is an incorrect action. Redo log for missing files should only be ignored if innodb_force_recovery=1 or more.

      CURRENT_TEST: innodb.log_file_name
      2017-10-11 12:01:15 139847651086784 [Note] /mariadb/10.2/bld/sql/mysqld (mysqld 10.2.10-MariaDB-log) starting as process 30950 ...
      

      The first startup message is the first (failed) recovery attempt after the test killed the server. There are several failed startup attempts initiated by the test. The last messages are from the last recovery attempt, which should have succeeded.

      On the second recovery attempt we got error messages for the file t3.ibd, but did not refuse startup as expected:

      2017-10-11 12:01:21 140400653447616 [ERROR] InnoDB: The error means the system cannot find the path specified.
      2017-10-11 12:01:21 140400653447616 [ERROR] InnoDB: If you are installing InnoDB, remember that you must create directories yourself, InnoDB does not create them.
      2017-10-11 12:01:21 140400653447616 [ERROR] InnoDB: Cannot open datafile for read-only: './test/t3.ibd' OS error: 71
      2017-10-11 12:01:21 140400653447616 [ERROR] InnoDB: Operating system error number 2 in a file operation.
      2017-10-11 12:01:21 140400653447616 [ERROR] InnoDB: The error means the system cannot find the path specified.
      2017-10-11 12:01:21 140400653447616 [ERROR] InnoDB: If you are installing InnoDB, remember that you must create directories yourself, InnoDB does not create them.
      2017-10-11 12:01:21 140400653447616 [ERROR] InnoDB: Could not find a valid tablespace file for `test/t3`. Please refer to http://dev.mysql.com/doc/refman/5.7/en/innodb-troubleshooting-datadict.html for how to resolve the issue.
      2017-10-11 12:01:21 140400653447616 [Warning] InnoDB: Ignoring tablespace for `test`.`t3` because it could not be opened.
      2017-10-11 12:01:21 140400653447616 [Note] InnoDB: 128 out of 128 rollback segments are active.
      2017-10-11 12:01:21 140400653447616 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
      2017-10-11 12:01:21 140400653447616 [Note] InnoDB: Creating shared tablespace for temporary tables
      2017-10-11 12:01:21 140400653447616 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
      2017-10-11 12:01:21 140400653447616 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
      2017-10-11 12:01:21 140400653447616 [Note] InnoDB: 5.7.19 started; log sequence number 95773105
      

      This corresponds to the following test snippet:

      --echo # Fault 2: Wrong space_id in a dirty file, and a missing file.
      --move_file $MYSQLD_DATADIR/test/t3.ibd $MYSQLD_DATADIR/test/t1.ibd
       
      --source include/start_mysqld.inc
      eval $check_no_innodb;
       
      let SEARCH_PATTERN= InnoDB: Ignoring data file '.*t1.ibd' with space ID.*;
      --source include/search_pattern_in_file.inc
       
      let SEARCH_PATTERN= InnoDB: Tablespace \d+ was not found at.*t3.ibd.*;
      --source include/search_pattern_in_file.inc
       
      --source include/shutdown_mysqld.inc
      

      In the log_file_name.log we indeed got the unexpected result that InnoDB did start up:

      # Fault 2: Wrong space_id in a dirty file, and a missing file.
      SELECT * FROM INFORMATION_SCHEMA.ENGINES
      WHERE engine = 'innodb'
      AND support IN ('YES', 'DEFAULT', 'ENABLED');
      ENGINE	SUPPORT	COMMENT	TRANSACTIONS	XA	SAVEPOINTS
      InnoDB	YES	Supports transactions, row-level locking, foreign keys and encryption for tables	YES	YES	YES
      FOUND 1 /InnoDB: Ignoring data file '.*t1.ibd' with space ID.*/ in mysqld.1.err
      FOUND 1 /InnoDB: Tablespace \d+ was not found at.*t3.ibd.*/ in mysqld.1.err
      

        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: