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

Make Online DDL to Instant DDL when table is empty

Details

    Description

      During prepare phase ha_innobase::prepare_inplace_alter_table() can check whether the table is empty and if it is then it can take S-lock on the
      innodb table. So it eventually blocks concurrent DML to happen on the table. Skip the online alter phase and avoid the old table clustered index
      read. InnoDB can rely on stat_n_rows in dict_table_t to find the table emptiness. InnoDB doesn't have to rely on MDL if relies on InnoDB lock.
      InnoDB could reduce the time taken for DDL if table is empty.

      Attachments

        Issue Links

          Activity

            thiru Thirunarayanan Balathandayuthapani created issue -
            thiru Thirunarayanan Balathandayuthapani made changes -
            Field Original Value New Value
            Description During prepare phase, if the table has no rows then InnoDB can take S-lock on the table
            and skip the online alter phase. InnoDB can rely on {{stat_n_rows}} in {{dict_table_t}}.

            InnoDB doesn't have to rely on MDL. It can skip {{ha_innobase::inplace_alter_table()}}
            to avoid concurrent DML. It could reduce the time taken for DDL
            During prepare phase {{ha_innobase::prepare_inplace_alter_table()}} can check whether the table is empty and if it is then it can take S-lock on the
            innodb table. So it eventually blocks concurrent DML to happen on the table. Skip the online alter phase and avoid the old table clustered index
            read. InnoDB can rely on {{stat_n_rows}} in {{dict_table_t}} to find the table emptiness. InnoDB doesn't have to rely on MDL if relies on InnoDB lock.
            InnoDB could reduce the time taken for DDL if table is empty.
            thiru Thirunarayanan Balathandayuthapani made changes -
            thiru Thirunarayanan Balathandayuthapani made changes -
            Fix Version/s 10.6 [ 24028 ]
            Fix Version/s 10.5 [ 23123 ]
            serg Sergei Golubchik made changes -
            Fix Version/s 10.7 [ 24805 ]
            Fix Version/s 10.6 [ 24028 ]
            ralf.gebhardt Ralf Gebhardt made changes -
            Fix Version/s 10.8 [ 26121 ]
            Fix Version/s 10.7 [ 24805 ]
            thiru Thirunarayanan Balathandayuthapani made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            thiru Thirunarayanan Balathandayuthapani made changes -
            Assignee Thirunarayanan Balathandayuthapani [ thiru ] Marko Mäkelä [ marko ]
            Status In Progress [ 3 ] In Review [ 10002 ]

            bb-10.6-MDEV-23805 33b64f89803042849b16089754506532a46a7eff 2021-11-11T15:12:30+05:30 behaved well in RQG testing.

            mleich Matthias Leich added a comment - bb-10.6- MDEV-23805 33b64f89803042849b16089754506532a46a7eff 2021-11-11T15:12:30+05:30 behaved well in RQG testing.
            thiru Thirunarayanan Balathandayuthapani made changes -
            Fix Version/s 10.8.0 [ 26800 ]
            Fix Version/s 10.4.23 [ 26807 ]
            Fix Version/s 10.5.14 [ 26809 ]
            Fix Version/s 10.6.6 [ 26811 ]
            Fix Version/s 10.7.2 [ 26813 ]
            Fix Version/s 10.8 [ 26121 ]
            Resolution Fixed [ 1 ]
            Status In Review [ 10002 ] Closed [ 6 ]
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -

            This simplification of locking may have made redundant the fixes of the race conditions MDEV-16131 and MDEV-24730. I had to adjust some test cases due to intermittent failures.

            marko Marko Mäkelä added a comment - This simplification of locking may have made redundant the fixes of the race conditions MDEV-16131 and MDEV-24730 . I had to adjust some test cases due to intermittent failures.
            serg Sergei Golubchik made changes -
            Workflow MariaDB v3 [ 113792 ] MariaDB v4 [ 134344 ]
            thiru Thirunarayanan Balathandayuthapani made changes -

            People

              marko Marko Mäkelä
              thiru Thirunarayanan Balathandayuthapani
              Votes:
              2 Vote for this issue
              Watchers:
              6 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.