All Products
Search
Document Center

The RDS MySQL instance is locked because the disk of the instance is full.

Last Updated: Dec 28, 2020

Problem description

If the instance disk is full, the instance is locked and data cannot be written to the instance. In this case, the instance is changed to a read-only instance and read /write mode to read-only.

Cause

There are four types of disk space for apsaradb RDS for MySQL instances. A disk is locked because disk space are occupied by the following four types of files:

Solution

Check the cause of the excessive disk space usage.

Log on to the apsaradb for RDS console, and select monitoring and alarms to view the resource monitoring monitoring metrics in disk space.

The disk space occupied by data files is too large.

Applicable to RDS MySQL 5.5 instances

After the instance is upgraded disk space, you can run the drop or truncate command to clear tables.

Note:

  • The cleanup operation completely deletes the table or table data and releases physical space. Proceed with caution.
  • Do not run the delete statement. Because the number of binlogs increases due to the delete statement, you cannot directly release the physical storage.

Applicable to RDS MySQL 5.6 instances, RDS MySQL 5.7 instances, and RDS MySQL 8.0 instances

  • Method 1: upgrade the disk space to unlock the instance. After unlocking the instance, you can run the drop or truncate command to clear tables.
    Note:
    • The cleanup operation completely deletes the table or table data and releases physical space. Proceed with caution.
    • Do not run the delete statement. Because the number of binlogs increases due to the delete statement, you cannot directly release the physical storage.
  • Method 2: Upgrade your instance to the latest kernel version. When your instance is locked, you can run the drop and truncate commands to perform operations. You can run the drop or truncate commands to clear tables to unlock the instance.
    Note: this operation completely deletes the table or table data and releases the physical space. Proceed with caution.

The disk space occupied by the log files is too large.

Applicable to RDS MySQL 5.7 SSD Basic edition instances

Submit a ticket for verification.

 

Applicable to RDS MySQL 5.5 instances, RDS MySQL 5.6 instances, RDS MySQL 5.7 High-availability edition instances, and RDS MySQL 8.0 instances

  • Method 1: upgrade the disk space to unlock the instance. Full disk space is applicable for SSD instances of the basic or high-availability edition. When the disk is full, upgrade the disk to solve the problem. We recommend that you monitor the disk and set alerts for the disk space in advance to locate the full disk and lock the instance.
  • Method 2: log on to the RDS console. On the backup and restoration page, click Upload binlogs to clear binlogs to unlock the instance. This operation depends on the number and size of binlogs. You only need to click it once, and do not need to click it repeatedly. After you click the button, observe whether the disk usage has decreased in 10 to 20 minutes. If not, submit a ticket to check whether the disk usage has decreased.

The disk space occupied by system files is too large.

Applicable to RDS MySQL 5.5 instances and RDS MySQL 5.6 instances

The error message returned because the ibdata1 file occupies a large amount disk space. The ibdata1 file is too large because it contains the undo log space. The ibdata1 file cannot be scaled down in apsaradb RDS for MySQL. To completely solve the problem of ibdata1, you must create a new instance and migrate your business data to the new instance.

Note: The undo log is a log used for rollback. The undo operation rolls back and forth to a specific version. The undo log is generally a logical log.

Applicable to RDS MySQL 5.7 instances and RDS MySQL 8.0 instances

RDS MySQL 5.7 and 8.0 have separated undo tablespaces and ibdata1 system tablespaces, and have cleaned up the files accordingly. Therefore, undo log and ibdata1 files will not cause too large a disk space. However, versions 5.7 and 8.0 have added ibtmp tablespaces, which are divided into system files. When the file is not properly used, this will increase the ibtmp file, which will lock the disk. You can perform the following operations:

  1. Run the following SQL statement to obtain the tablespace usage:
    select * from INFORMATION_SCHEMA.FILES order by TOTAL_EXTENTS desc limit 100;
  2. If the size of the ibtmp file is too large, restart the instance to release the space for the ibtmp file.

The disk space occupied by temporary files is too large.

Tips: Applicable to RDS MySQL 5.5 instances, RDS MySQL 5.6 instances, RDS MySQL 5.7 instances, and RDS MySQL 8.0 instances.

If the temporary files occupy too much space, restart the instance to release the temporary space.

Application scope

  • ApsaraDB RDS for MySQL