All Products
Search
Document Center

ApsaraDB RDS:What to do when an instance status is 'Locking'?

Last Updated:Mar 28, 2026

When an RDS instance enters the Locking state, INSERT and UPDATE operations are blocked. This article explains how to identify the cause and restore the instance to the Running state.

Lock types

The Locking state covers different lock types depending on your MySQL minor engine version. Understanding which type is active helps you choose the correct recovery action.

Applies to: ApsaraDB RDS for MySQL 5.6, 5.7, and 8.0 with minor engine version 20190815 or later.

Lock typeTriggerBlocked operations
LOCK_WRITE_GROWTHPrimary instance storage exhaustedOperations that increase disk usage. Use DROP or TRUNCATE instead of DELETE, because DELETE generates binary log files and increases disk usage.
LOCK_READRead-only instance storage exhaustedAll read and write operations
LOCK_WRITEInstance expiration, ApsaraDB MyBase host expiration, or instance migrationAll write operations including DROP and TRUNCATE

When LOCK_WRITE_GROWTH is active, executing a blocked SQL statement returns:

ERROR 1290 (HY000): The MySQL server is running with the LOCK_WRITE_GROWTH option so it cannot execute this statement
For RDS instances running MySQL 5.1 or 5.5, or MySQL 5.6, 5.7, and 8.0 with a minor engine version earlier than 20190815, the instance is fully locked regardless of the cause. No operations are permitted.

Identify the cause

On the Basic Information page of your RDS instance, check the Status field.

image

The two most common causes are:

  • Storage exhausted: The instance storage capacity is full.

  • Overdue payment or expiration: Your Alibaba Cloud account has an overdue payment, or a subscription instance has expired.

Resolve a storage issue

Go to Monitoring and Alerts in the left-side navigation pane to see storage usage by category. Then take one of the following actions based on what is consuming the most space.

Warning

Back up your data before deleting anything to prevent data loss. Expanding storage capacity is a safe alternative to data deletion.

Release storage

Temporary files (temp_file_size)

ApsaraDB RDS for MySQL generates temporary tables for sorting, grouping, and join operations, and binary log cache files before large transactions are committed. For steps to clear temporary files, see What do I do if an ApsaraDB RDS for MySQL instance is in the Locked state because its storage capacity is exhausted by temporary files?

Log files (binlog_size, general_log_size)

Database engineResolution
MySQLView storage usage on the Monitoring and Alerts page, then delete log files. See What do I do if the storage capacity of an ApsaraDB RDS for MySQL instance is exhausted by binary log files? and Solution for an instance with full disk space caused by the General log
PostgreSQLYou cannot delete log files manually. Delete inactive replication slots to let AliPG automatically remove WAL logs. See Use the WAL log management feature for an ApsaraDB RDS for PostgreSQL instance
SQL ServerYou cannot delete log files manually. Shrink transaction logs in the ApsaraDB RDS console. See Troubleshoot insufficient storage space issues on an ApsaraDB RDS for SQL Server instance

Data files (user_data_size)

For MySQL:

  1. Connect to your RDS instance using Data Management (DMS).

  2. Run the following query to find the largest tables:

    SELECT
        TABLE_NAME,
        concat(round((DATA_LENGTH + INDEX_LENGTH) / 1024 / 1024,2),'MB') AS DATA
    FROM
        information_schema. TABLES
    WHERE
        TABLE_SCHEMA = '<Database name>'
    ORDER BY
        DATA + 0 DESC;
  3. Drop tables that contain historical or unnecessary data:

    DROP TABLE <Table name>;
  4. Wait approximately 5 minutes. The system unlocks the instance automatically once storage drops below the limit.

For PostgreSQL:

  1. Connect to your RDS instance using DMS. See Use DMS to log on to an ApsaraDB RDS instance.

    If you cannot connect, expand storage capacity first, clear disk space, then reduce storage as needed. See Change instance specifications.
  2. Run the following query to identify large tables:

    SELECT
        table_schema || '.' || table_name AS table_full_name,
        pg_total_relation_size('"' || table_schema || '"."' || table_name || '"') AS size
    FROM
        information_schema.tables
    ORDER BY
        pg_total_relation_size('"' || table_schema || '"."' || table_name || '"')
    DESC;
  3. Drop tables that contain historical or unnecessary data:

    DROP TABLE <Table name>;
  4. Wait approximately 5 minutes. The system unlocks the instance automatically.

For SQL Server:

Follow the steps in Troubleshoot insufficient storage issues on an ApsaraDB RDS for SQL Server instance.

System files (undolog_size)

Excessive undo logs accumulate when long-running queries on InnoDB tables coincide with large data modifications. For resolution steps, see Troubleshoot insufficient storage caused by system file accumulation.

Expand storage capacity

  1. Go to the Instances page. Select the region where your RDS instance resides, then click the instance ID.

  2. In the Configuration Information section of the Basic Information page, click Change Specifications to expand the storage capacity.

  3. After completing payment, check progress in Task Center.

Expansion duration varies by storage type:

Storage typeDurationNotes
Premium Local SSDsVariesMay trigger cross-instance data migration. A transient connection lasting approximately 30 seconds occurs. Expand during off-peak hours and configure your application to reconnect automatically.
Cloud disksAbout 5 minutesMySQL and PostgreSQL: no transient connections. SQL Server: a transient connection lasting approximately 30 seconds may occur; during the transient connection, you cannot perform most of the operations related to databases, accounts, and network settings. Expand during off-peak hours or configure your application to reconnect automatically. Specific RDS instances support storage expansion without data loss, which does not interrupt workloads.

Resolve an overdue payment or expiration

  • Subscription RDS instance: Renew the instance, then wait approximately 5 minutes and verify the instance status is Running.

  • Pay-as-you-go RDS instance: Top up your Alibaba Cloud account, then wait 5 minutes and verify the instance status is Running.

Prevent future locks

Configure the following to avoid the Locking state:

FAQ

Why is LOCK_WRITE_GROWTH still active after I deleted a large amount of data?

Running DELETE marks the removed records or data pages as reusable but does not shrink the underlying disk files or reclaim tablespace. To actually free disk space, run OPTIMIZE TABLE after deletion.

The instance still shows Locking even though storage is sufficient and payment is current

A task, such as a configuration change task, on the RDS instance is in progress. The instance unlocks automatically once the task completes. Click the 按钮 icon in the upper-right corner of the Basic Information page to open the Tasks page and check progress.

Can I change instance specifications while the instance is locked?

If the instance is locked due to storage exhaustion, you can upgrade or downgrade specifications. If it is locked for other reasons such as overdue payments, resolve the payment issue first.

The locked instance uses a phased-out instance type. How do I expand storage?

Change to an available instance type first, then expand storage. For available types, see Primary ApsaraDB RDS instance types.

Why does storage usage keep increasing while the instance is locked?

INSERT and UPDATE operations are blocked, but SELECT queries can still generate log files and temporary data, which increases storage usage.