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

InnoDB system tablespace cannot be shrunk

Details

    Description

      hello
      i used to have all tables on ibdata1 before, then i switched to one file per table, but the ibdata1 file keep its size.
      I recently switched to mariadb 10.1, and hoped that the defragmenting function would help to shrink the file, but it didn't worked.
      I optimised all tables, but the ibdata1 file did not changed at all, it is still 197gb

      MariaDB [(none)]> show status like '%defragment%';
      +----------------------------------------+--------+
      | Variable_name                          | Value  |
      +----------------------------------------+--------+
      | Innodb_defragment_compression_failures | 0      |
      | Innodb_defragment_failures             | 32872  |
      | Innodb_defragment_count                | 113744 |
      +----------------------------------------+--------+
      3 rows in set (0.01 sec)
      

      MariaDB [(none)]> show variables like '%defragment%';
      +--------------------------------------+----------+
      | Variable_name                        | Value    |
      +--------------------------------------+----------+
      | innodb_defragment                    | ON       |
      | innodb_defragment_fill_factor        | 0.900000 |
      | innodb_defragment_fill_factor_n_recs | 20       |
      | innodb_defragment_frequency          | 40       |
      | innodb_defragment_n_pages            | 7        |
      | innodb_defragment_stats_accuracy     | 0        |
      +--------------------------------------+----------+
      

      Attachments

        Issue Links

          Activity

            martina342 martina342 created issue -
            elenst Elena Stepanova made changes -
            Field Original Value New Value
            Description hello
            i used to have all tables on ibdata1 before, then i switched to one file per table, but the ibdata1 file keep its size.
            I recently switched to mariadb 10.1, and hoped that the defragmenting function would help to shrink the file, but it didn't worked.
            I optimised all tables, but the ibdata1 file did not changed at all, it is still 197gb

            MariaDB [(none)]> show status like '%defragment%';
            +----------------------------------------+--------+
            | Variable_name | Value |
            +----------------------------------------+--------+
            | Innodb_defragment_compression_failures | 0 |
            | Innodb_defragment_failures | 32872 |
            | Innodb_defragment_count | 113744 |
            +----------------------------------------+--------+
            3 rows in set (0.01 sec)

            MariaDB [(none)]> show variables like '%defragment%';
            +--------------------------------------+----------+
            | Variable_name | Value |
            +--------------------------------------+----------+
            | innodb_defragment | ON |
            | innodb_defragment_fill_factor | 0.900000 |
            | innodb_defragment_fill_factor_n_recs | 20 |
            | innodb_defragment_frequency | 40 |
            | innodb_defragment_n_pages | 7 |
            | innodb_defragment_stats_accuracy | 0 |
            +--------------------------------------+----------+
            hello
            i used to have all tables on ibdata1 before, then i switched to one file per table, but the ibdata1 file keep its size.
            I recently switched to mariadb 10.1, and hoped that the defragmenting function would help to shrink the file, but it didn't worked.
            I optimised all tables, but the ibdata1 file did not changed at all, it is still 197gb

            {noformat}
            MariaDB [(none)]> show status like '%defragment%';
            +----------------------------------------+--------+
            | Variable_name | Value |
            +----------------------------------------+--------+
            | Innodb_defragment_compression_failures | 0 |
            | Innodb_defragment_failures | 32872 |
            | Innodb_defragment_count | 113744 |
            +----------------------------------------+--------+
            3 rows in set (0.01 sec)
            {noformat}
            {noformat}
            MariaDB [(none)]> show variables like '%defragment%';
            +--------------------------------------+----------+
            | Variable_name | Value |
            +--------------------------------------+----------+
            | innodb_defragment | ON |
            | innodb_defragment_fill_factor | 0.900000 |
            | innodb_defragment_fill_factor_n_recs | 20 |
            | innodb_defragment_frequency | 40 |
            | innodb_defragment_n_pages | 7 |
            | innodb_defragment_stats_accuracy | 0 |
            +--------------------------------------+----------+
            {noformat}
            elenst Elena Stepanova made changes -
            Component/s Documentation [ 10903 ]
            Component/s Storage Engine - InnoDB [ 10129 ]
            Fix Version/s 10.1 [ 16100 ]
            Assignee Jan Lindström [ jplindst ]
            jplindst Jan Lindström (Inactive) made changes -
            Assignee Jan Lindström [ jplindst ] Ian Gilfillan [ greenman ]
            greenman Ian Gilfillan made changes -
            Fix Version/s N/A [ 14700 ]
            Fix Version/s 10.1 [ 16100 ]
            Resolution Fixed [ 1 ]
            Status Open [ 1 ] Closed [ 6 ]
            rock.mutchler Rock Mutchler (Inactive) made changes -
            serg Sergei Golubchik made changes -
            Workflow MariaDB v3 [ 84632 ] MariaDB v4 [ 153459 ]
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            Assignee Ian Gilfillan [ greenman ] Thirunarayanan Balathandayuthapani [ thiru ]
            Resolution Fixed [ 1 ]
            Status Closed [ 6 ] Stalled [ 10000 ]
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            Fix Version/s 10.12 [ 28320 ]
            Fix Version/s N/A [ 14700 ]
            Summary Defragmenting does not shrink ibdata1 InnoDB system tablespace cannot be shrunk
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            julien.fritsch Julien Fritsch made changes -
            Priority Major [ 3 ] Critical [ 2 ]
            marko Marko Mäkelä made changes -
            serg Sergei Golubchik made changes -
            serg Sergei Golubchik made changes -
            thiru Thirunarayanan Balathandayuthapani made changes -
            Status Stalled [ 10000 ] In Progress [ 3 ]
            marko Marko Mäkelä made changes -
            julien.fritsch Julien Fritsch made changes -
            Priority Critical [ 2 ] Blocker [ 1 ]
            serg Sergei Golubchik made changes -
            Priority Blocker [ 1 ] Critical [ 2 ]
            julien.fritsch Julien Fritsch made changes -
            Priority Critical [ 2 ] Blocker [ 1 ]
            serg Sergei Golubchik made changes -
            Priority Blocker [ 1 ] Critical [ 2 ]
            julien.fritsch Julien Fritsch made changes -
            Environment debian 9
            Issue Type Bug [ 1 ] Task [ 3 ]
            thiru Thirunarayanan Balathandayuthapani made changes -
            Fix Version/s 11.0 [ 28320 ]
            thiru Thirunarayanan Balathandayuthapani made changes -
            Fix Version/s 11.2 [ 28603 ]
            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 -
            Assignee Marko Mäkelä [ marko ] Thirunarayanan Balathandayuthapani [ thiru ]
            Status In Review [ 10002 ] Stalled [ 10000 ]
            marko Marko Mäkelä made changes -
            thiru Thirunarayanan Balathandayuthapani made changes -
            Status Stalled [ 10000 ] In Testing [ 10301 ]
            thiru Thirunarayanan Balathandayuthapani made changes -
            Assignee Thirunarayanan Balathandayuthapani [ thiru ] Matthias Leich [ mleich ]
            mleich Matthias Leich made changes -
            Assignee Matthias Leich [ mleich ] Thirunarayanan Balathandayuthapani [ thiru ]
            Status In Testing [ 10301 ] Stalled [ 10000 ]
            marko Marko Mäkelä made changes -
            ralf.gebhardt Ralf Gebhardt made changes -
            Labels Preview_11.2
            thiru Thirunarayanan Balathandayuthapani made changes -
            Status Stalled [ 10000 ] In Progress [ 3 ]
            thiru Thirunarayanan Balathandayuthapani made changes -
            Assignee Thirunarayanan Balathandayuthapani [ thiru ] Marko Mäkelä [ marko ]
            Status In Progress [ 3 ] In Review [ 10002 ]
            mleich Matthias Leich made changes -
            Comment [ {noformat}
            origin/bb-11.2-MDEV-14795_1 1779cb1af979cad1abe9d5c3ed4d37b6503175aa 2023-07-11T20:25:49+05:30
            behaved relative well in RQG testing. I observed many bad effects but they occured/occur in preview-11.2,
            11.2 b8c039fad16adf9cbc6dac2e34cdeb772b9065a0 2023-07-07T09:05:33+10:00
            and sometimes other trees too.

            The main testing campaign consisted of ~ 9900 tests which all used the server
            startup option "--mysqld=--innodb_data_file_path=ibdata1:1M:autoextend:autoshrink".
            Statistics from the remaining test results:
            smallest system tablespace ever shrinked 1024 pages
            biggest system tablespace ever shrinked 41152 pages
            biggest shrink operation ~ 16000 pages truncated
            smallest shrink operation ~ 250 pages truncated

            {noformat}
            ]
            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.2.1 [ 29034 ]
            Fix Version/s 11.2 [ 28603 ]
            Resolution Fixed [ 1 ]
            Status Stalled [ 10000 ] Closed [ 6 ]
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            julien.fritsch Julien Fritsch made changes -
            marko Marko Mäkelä made changes -
            ralf.gebhardt Ralf Gebhardt made changes -
            marko Marko Mäkelä made changes -
            rob.schwyzer@mariadb.com Rob Schwyzer (Inactive) made changes -
            rob.schwyzer@mariadb.com Rob Schwyzer (Inactive) made changes -
            marko Marko Mäkelä made changes -
            mariadb-jira-automation Jira Automation (IT) made changes -
            Zendesk Related Tickets 113383
            ralf.gebhardt Ralf Gebhardt made changes -
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            thiru Thirunarayanan Balathandayuthapani made changes -
            marko Marko Mäkelä made changes -

            People

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