Updated on 2026-08-04 GMT+08:00

Partition-level MDL

Scenarios

In MySQL Community Edition, you cannot perform both data manipulation language (DML) operations for accessing data of partitioned tables and data definition language (DDL) operations for maintaining partitions at the same time. This means that DDL operations can only be done during off-peak hours. However, the frequent creation and deletion of partitions greatly limits the use of partitioned tables.

To resolve such an issue, TaurusDB introduces partition-level metadata lock (MDL) to refine the lock granularity of a partitioned table from the table level to the partition level. After partition-level MDL is enabled, DML operations and specific DDL operations (such as adding and deleting partitions) on different partitions can be both performed, greatly improving concurrency between partitions.

Constraints

  • Partition-level MDL is only available for ADD PARTITION operations for RANGE and LIST partitioning and DROP PARTITION operations.
  • ADD PARTITION and DROP PARTITION operations only support the INPLACE algorithm.
  • The isolation level can be set to the session level. If transaction_isolation is set to REPEATABLE-READ or a higher isolation level, the following error may be reported when DDL operations are performed concurrently:
    ERROR HY000: Table definition has changed, please retry transaction.

    This is normal because a transaction accesses the new partition created by DDL. To resolve this issue, you can simply re-execute the transaction.

Prerequisites

  • The kernel version of your TaurusDB instance must be 2.0.57.240900 or later. For details about how to check the kernel version, see How Can I Check the Version of a TaurusDB Instance?
  • The global isolation level of transaction_isolation must be set to READ-COMMITTED.

Enabling Partition-level MDL

You can set the rds_partition_level_mdl_enabled parameter to configure partition-level MDL.

Table 1 Parameter description

Parameter

Level

Description

rds_partition_level_mdl_enabled

Global

Controls whether to enable partition-level MDL.

ON: Partition-level MDL is enabled.

OFF (default value): Partition-level MDL is disabled.

NOTE:

A reboot is required to apply the parameter modification.

Examples