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

os_file_set_size() may not work on O_DIRECT files

    XMLWordPrintable

Details

    Description

      The test innodb.log_data_file_size would fail on a block device where the block size is 4096 bytes:

      10.6 63e9a05440953bf451ebe1cd808ca445e4c7634e

      innodb.log_data_file_size '16k,innodb'   w6 [ fail ]  Found warnings/errors in server log file!
              Test ended at 2021-06-29 06:49:46
      line
      2021-06-29  6:49:45 0 [Warning] InnoDB: Retry attempts for writing partial data failed.
      2021-06-29  6:49:45 0 [ERROR] InnoDB: Write to file ./test/ibd4f.ibd failed at offset 66770, 47918 bytes should have been written, only 0 were written. Operating system error number 22. Check that your OS and file system support files of this size. Check also that the disk is not full or a disk quota exceeded.
      2021-06-29  6:49:45 0 [ERROR] InnoDB: Error number 22 means 'Invalid argument'
      2021-06-29  6:49:45 0 [ERROR] InnoDB: Cannot apply log to [page id: space=6, page number=0] of corrupted file './test/ibd4f.ibd'
      2021-06-29  6:49:45 0 [ERROR] InnoDB: Plugin initialization aborted with error Data structure corruption
      2021-06-29  6:49:45 0 [ERROR] Plugin 'InnoDB' init function returned error.
      2021-06-29  6:49:45 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
      

      The reason is that we fail to round the current file size down to a multiple of the file system block size.

      Arguably, this is a corner case where the file size has been doctored by the environment. In MariaDB Server 10.6 this is more prominent, because MDEV-24854 set innodb_flush_method=O_DIRECT by default.

      Attachments

        Issue Links

          Activity

            People

              marko Marko Mäkelä
              marko Marko Mäkelä
              Votes:
              0 Vote for this issue
              Watchers:
              1 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.