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

InnoDB/XtraDB recovery should fail early if datadir is not readable

    XMLWordPrintable

Details

    Description

      If mysqld has no read permission on the data directory it will normally pass InnoDB initialization, but will fail with a clear error message during Aria initialization:

        160302 10:09:27 [ERROR] mysqld: File '/usr/local/mysql-maria-10.0.16/var/' not found (Errcode: 13 "Permission denied")
        160302 10:09:27 [ERROR] mysqld: Aria engine: log initialization failed
        160302 10:09:27 [ERROR] Plugin 'Aria' init function returned error.
        160302 10:09:27 [ERROR] Plugin 'Aria' registration as a STORAGE ENGINE failed.
        160302 10:09:27 [ERROR] Aria engine is not enabled or did not start. The Aria engine must be enabled to continue as mysqld was configured with --with-aria-tmp-tables
        160302 10:09:27 [ERROR] Aborting
      

      Here the problem "Permission denied" is clearly stated, and the directory name is given.

      If InnoDB requires crash recovery though it will also complain about the permission problem, but is only giving the error number and does not print the directory name:

        160302 10:12:57 [Note] InnoDB: Reading tablespace information from the .ibd files...
        2016-03-02 10:12:57 7f12e5e67740  InnoDB: Operating system error number 13 in a file operation.
        InnoDB: The error means mysqld does not have the access rights to
        InnoDB: the directory.
      

      followed by an error message for every per-table .idb file, e.g.:

      160302 10:12:58 [ERROR] InnoDB: Table mysql/gtid_slave_pos in the InnoDB data dictionary has tablespace id 3, but tablespace with that id or name does not exist. Have you deleted or moved .ibd files? This may also be a table created with CREATE TEMPORARY TABLE whose .ibd and .frm files MySQL automatically removed, but the table still exists in the InnoDB internal data dictionary.
      InnoDB: Please refer to
      InnoDB: http://dev.mysql.com/doc/refman/5.6/en/innodb-troubleshooting-datadict.html
      InnoDB: for how to resolve the issue.
      

      This makes the actual permission error messages easy to miss in the flood of .ibd per-table related messages.

      How to reproduce:

      • kill running mysqld with kill -9 to force InnoDB recovery
      • chmod u-r $data_dir
      • restart mysqld

      IMHO InnoDB crash recovery should already fail hard after the initial permission error, it is pretty clear at that point already that full recovery will not be possible.

      Also the initial InnoDB error message should contain the textual error description from perror()/strerror() "Permission denied" and should print the directory path, to make clear what the error is and on which directory it happened.

      Attachments

        Activity

          People

            marko Marko Mäkelä
            hholzgra Hartmut Holzgraefe
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.