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

fsp_free_page() fails to move the extent from FSP_FREE_FRAG to FSP_FREE list

Details

    Description

      InnoDB should set the XDES_FREE_BIT of the page before checking whether the
      current extent is free.

              if (!xdes_get_n_used(descr)) {
                      /* The extent has become free: move it to another list */
                      err = flst_remove(header, FSP_HEADER_OFFSET + FSP_FREE_FRAG,
                                        xdes, xoffset, mtr);
                      if (UNIV_UNLIKELY(err != DB_SUCCESS)) {
                              return err;
                      }
                      err = fsp_free_extent(space, offset, mtr);
                      if (UNIV_UNLIKELY(err != DB_SUCCESS)) {
                              return err;
                      }
              }
       
              mtr->free(*space, static_cast<uint32_t>(offset));
              xdes_set_free<true>(*xdes, descr, offset % FSP_EXTENT_SIZE, mtr);
      

      This issue was caused in 10.6 by the following patch:

      commit 0b47c126e31cddda1e94588799599e138400bcf8
      Author: Marko Mäkelä <marko.makela@mariadb.com>
      Date:   Mon Jun 6 14:03:22 2022 +0300
       
          MDEV-13542: Crashing on corrupted page is unhelpful
      

      Attachments

        Issue Links

          Activity

            thiru Thirunarayanan Balathandayuthapani created issue -
            thiru Thirunarayanan Balathandayuthapani made changes -
            Field Original Value New Value
            Status Open [ 1 ] In Progress [ 3 ]

            Patch is in bb-10.6-MDEV-31333

            thiru Thirunarayanan Balathandayuthapani added a comment - Patch is in bb-10.6- MDEV-31333
            thiru Thirunarayanan Balathandayuthapani made changes -
            Assignee Thirunarayanan Balathandayuthapani [ thiru ] Marko Mäkelä [ marko ]
            Status In Progress [ 3 ] In Review [ 10002 ]
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            Fix Version/s 10.8 [ 26121 ]
            Affects Version/s 10.9.2 [ 27115 ]
            Affects Version/s 10.6.9 [ 27507 ]
            Affects Version/s 10.7 [ 24805 ]

            OK to push. Thank you for catching this.

            I understand that writing a test case for this is tricky. We will cover this in MDEV-14795, which is where you found this regression.

            marko Marko Mäkelä added a comment - OK to push. Thank you for catching this. I understand that writing a test case for this is tricky. We will cover this in MDEV-14795 , which is where you found this regression.
            marko Marko Mäkelä made changes -
            Assignee Marko Mäkelä [ marko ] Thirunarayanan Balathandayuthapani [ thiru ]
            Status In Review [ 10002 ] Stalled [ 10000 ]
            thiru Thirunarayanan Balathandayuthapani made changes -
            Fix Version/s 11.1.1 [ 28704 ]
            Fix Version/s 10.6.14 [ 28914 ]
            Fix Version/s 10.9.7 [ 28916 ]
            Fix Version/s 10.10.5 [ 28917 ]
            Fix Version/s 10.11.4 [ 28918 ]
            Fix Version/s 10.6 [ 24028 ]
            Fix Version/s 10.9 [ 26905 ]
            Fix Version/s 10.10 [ 27530 ]
            Fix Version/s 10.11 [ 27614 ]
            Fix Version/s 11.0 [ 28320 ]
            Resolution Fixed [ 1 ]
            Status Stalled [ 10000 ] Closed [ 6 ]
            dbart Daniel Bartholomew made changes -
            Fix Version/s 10.6.15 [ 29013 ]
            Fix Version/s 10.9.8 [ 29015 ]
            Fix Version/s 10.10.6 [ 29017 ]
            Fix Version/s 10.11.5 [ 29019 ]
            Fix Version/s 11.1.2 [ 28921 ]
            Fix Version/s 11.1.1 [ 28704 ]
            Fix Version/s 10.6.14 [ 28914 ]
            Fix Version/s 10.9.7 [ 28916 ]
            Fix Version/s 10.10.5 [ 28917 ]
            Fix Version/s 10.11.4 [ 28918 ]

            Even though the extent is completely free, InnoDB fails to add the extent into FSP_FREE list. Extent doesn't get leaked in the tablespace.
            Subsequent user actions could make use of the freed extent in FSP_FREE_FRAG List. User won't get affected by this issue.

            thiru Thirunarayanan Balathandayuthapani added a comment - Even though the extent is completely free, InnoDB fails to add the extent into FSP_FREE list. Extent doesn't get leaked in the tablespace. Subsequent user actions could make use of the freed extent in FSP_FREE_FRAG List. User won't get affected by this issue.

            People

              thiru Thirunarayanan Balathandayuthapani
              thiru Thirunarayanan Balathandayuthapani
              Votes:
              0 Vote for this issue
              Watchers:
              2 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.