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

os_file_set_size() may not work on O_DIRECT files

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

            marko Marko Mäkelä created issue -
            marko Marko Mäkelä made changes -
            Field Original Value New Value
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            issue.field.resolutiondate 2021-06-29 12:17:24.0 2021-06-29 12:17:24.921
            marko Marko Mäkelä made changes -
            Fix Version/s 10.2.40 [ 26027 ]
            Fix Version/s 10.3.31 [ 26028 ]
            Fix Version/s 10.4.21 [ 26030 ]
            Fix Version/s 10.5.12 [ 26025 ]
            Fix Version/s 10.6.4 [ 26033 ]
            Fix Version/s 10.2 [ 14601 ]
            Fix Version/s 10.3 [ 22126 ]
            Fix Version/s 10.4 [ 22408 ]
            Fix Version/s 10.5 [ 23123 ]
            Fix Version/s 10.6 [ 24028 ]
            Resolution Fixed [ 1 ]
            Status Open [ 1 ] Closed [ 6 ]
            marko Marko Mäkelä made changes -
            Fix Version/s 10.6.3 [ 25904 ]
            Fix Version/s 10.6.4 [ 26033 ]
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            serg Sergei Golubchik made changes -
            Workflow MariaDB v3 [ 123096 ] MariaDB v4 [ 159456 ]

            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.