Will there be a metadata lock when adding a partition to a table with 2 billion partitions?

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: 20亿分区表,add parition会有元数据锁么?

| username: qiuxb

[TiDB Usage Environment] Production Environment / Testing / PoC
Production Environment
[TiDB Version]
v4.0.8
[Reproduction Path] Operations performed that led to the issue
[Encountered Issue: Issue Phenomenon and Impact]
Need to add a partition to a partitioned table with 2.2 billion rows of data. Noticed that there might be a metadata lock and want to confirm the lock wait situation and its impact range.
[Resource Configuration] Go to TiDB Dashboard - Cluster Info - Hosts and take a screenshot of this page
[Attachments: Screenshots / Logs / Monitoring]

| username: 大飞哥online | Original post link

There are already partitions, such as by year. Adding new yearly partitions later does not involve locking.

| username: qiuxb | Original post link

The documentation does not mention this aspect, so I am quite confused. Oracle and MySQL both have obvious MDL locks when adding partitions.

| username: tidb菜鸟一只 | Original post link

It should be the online dynamic partitioning feature supported starting from version 4.0.3, so it should be fine.

| username: h5n1 | Original post link

The MDL lock is only available after version 6.5, and DDL does not block DML.

| username: zhanggame1 | Original post link

We haven’t noticed any impact when using partitioning in Oracle.

| username: Soysauce520 | Original post link

The video course mentions online DDL.

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.