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

Allow DROP PARTITION without locking on non accessed partitions

    XMLWordPrintable

Details

    • Task
    • Status: Open (View Workflow)
    • Minor
    • Resolution: Unresolved
    • None
    • Partitioning
    • None

    Description

      Transactions on a partitioned table creates a metadata lock on the entire table that prevents non-accessed partitions to be dropped while there are active transactions on the table on any partition. This in turn, if a drop partition is issued, any other transactions on this table to wait, independent on the transaction. The meta_data_lock plugin reports this:

      +-----------+-------------------------+-----------------+----------------------+--------------+------------+
      | THREAD_ID | LOCK_MODE               | LOCK_DURATION   | LOCK_TYPE            | TABLE_SCHEMA | TABLE_NAME |
      +-----------+-------------------------+-----------------+----------------------+--------------+------------+
      |         5 | MDL_INTENTION_EXCLUSIVE | MDL_STATEMENT   | Global read lock     |              |            |
      |         6 | MDL_SHARED_WRITE        | MDL_TRANSACTION | Table metadata lock  | mydb         | t2         |
      |         5 | MDL_SHARED_UPGRADABLE   | MDL_TRANSACTION | Table metadata lock  | mydb         | t2         |
      |         5 | MDL_INTENTION_EXCLUSIVE | MDL_TRANSACTION | Schema metadata lock | mydb         |            |
      +-----------+-------------------------+-----------------+----------------------+--------------+------------+
      

      This to an extent cause the most important aspect of partitioning, managing old data by dropping partitions, to be much less useful.

      Attachments

        Activity

          People

            Unassigned Unassigned
            karlsson Anders Karlsson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.