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

Missleading "Out of memory" message on failure to write to innodb_tmpdir

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.5.13, 10.6.5
    • None
    • None

    Description

      When having innodb_tmpdir set to a directory that the MariaDB server process can't write to, then doing an INPLACE ALTER TABLE, and doing concurrent DML on the table in parallel, the ALTER TABLE will eventually fail with "Out of memory" error message even though the problem is actually file system / permission related.

      MariaDB [test]> alter table t1 engine=innodb, algorithm=inplace;
      ERROR 1041 (HY000): Out of memory.
      

      The DML statement in the other session on the other hand will report the problem correctly:

      MariaDB [test]> insert into t1 select null, md5(rand()) from t1 limit 10000;
      ERROR 1 (HY000): Can't create/write to file '/var/tmp/mysql/innodb_tmpdir/ibLWAFHd' (Errcode: 13 "Permission denied")
      

      What I also noticed: it was only the second time I ran the above INSERT in parallel to the ALTER that things failed. So INPLACE seems to first collect concurrent changes in Memory, and only start to write them to actual temporary files in innodb_tmdir after reaching a certain threshold?

      Maybe that's the reason for the "Out of memory" message: the memory buffer for this being full, and extending things to disk not being possible?

      Anyway, seeing two completely different error messages here is not good.

      The user running the concurrent INSERT may not even be aware of the ongoing ALTER and so may have no idea why there's suddenly an error message about not being able to create a file.

      And the user running the ALTER may not be aware of concurrent DML, especially when not explicitly setting the ALGORITHM (which includes running OPTIMIZE TABLE which implicitly does a copying ALTER TABLE in the background), and so will be left rather clueless with the "Out of memory" message.

      Attachments

        Activity

          People

            Unassigned Unassigned
            hholzgra Hartmut Holzgraefe
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

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