[MDEV-9978] Allow DROP PARTITION without locking on non accessed partitions Created: 2016-04-25  Updated: 2016-04-25

Status: Open
Project: MariaDB Server
Component/s: Partitioning
Fix Version/s: None

Type: Task Priority: Minor
Reporter: Anders Karlsson Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: 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.


Generated at Thu Feb 08 07:38:45 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.