All Products
Search
Document Center

ApsaraDB RDS:Resolve the issue of an RDS for MySQL instance being automatically locked due to exhausted storage

Last Updated:Mar 30, 2026

When disk space is exhausted, ApsaraDB RDS for MySQL automatically locks the instance to prevent data loss. While locked, the instance status shows Locked and write operations are blocked.

To unlock the instance, free up disk space by removing unnecessary files. After you clear enough space, the instance unlocks automatically within 5 to 15 minutes.

Identify the cause

Log on to the ApsaraDB RDS console, select the region in which the RDS instance resides in the top navigation bar, find the instance, and click the instance ID. In the left navigation pane, click Monitoring and Alarms to view disk space usage broken down by file type.

Five file types commonly exhaust disk space:

File type Typical cause
Data files High volume of data written to the database
Binary log files Misconfigured log backup policy combined with large transactions
Temporary files Sorting, grouping, or join operations that generate temporary tables; large uncommitted transactions
System files (undo files) Long-running queries on InnoDB tables concurrent with large data modifications. RDS for MySQL 8.0 automatically deletes undo files, so this is uncommon.
General query log (general_log) General logging enabled with high query volume or infrequent log rotation

Check the general query log size

If sys_data_size is large in the storage usage metrics, check whether the general_log parameter is set to ON, then connect to the instance and run:

SELECT table_schema AS 'Database', table_name,
  SUM(data_length + index_length + data_free)/1024/1024 AS "Table size in MB",
  SUM(DATA_FREE)/1024/1024 AS "Fragmentation size in MB"
FROM information_schema.TABLES
WHERE table_name='general_log'
Note

This query retrieves the size of the mysql.general_log table from information_schema and converts it to MB. The result is sample data and may differ slightly from the actual size.

Resolve the issue

Based on which file type is consuming disk space, follow the corresponding guide:

Verify the unlock

After clearing disk space, go to Monitoring and Alarms in the ApsaraDB RDS console and check that the instance status returns to Running. The unlock typically completes within 5 to 15 minutes.