Help Center/
Relational Database Service/
User Guide/
Working with RDS for MySQL/
Problem Diagnosis and SQL Analysis/
Problem Diagnosis/
Managing Locks & Transactions
Updated on 2024-10-14 GMT+08:00
Managing Locks & Transactions
Introduction
Metadata Locks
- Metadata locks are used for tables to prevent conflicting DDL and DML operations from being executed concurrently on these tables. Executing DDL statements on a table generates metadata write locks. If there is a metadata lock, all subsequent SELECT, DML, and DDL operations on the table will be blocked, causing a connection backlog.
- Metadata locks are displayed in real time. You can quickly identify problems and terminate the sessions with metadata locks to restore blocked operations.
- DML locks are not included. You can view and analyze them on the InnoDB Locks page.
- This function is available only in RDS for MySQL 5.6 and 5.7.
- A maximum of 1,000 records can be displayed.
InnoDB Locks
- InnoDB lock waits generated before DML operations are displayed in real time. You can quickly locate the session waits and any blocks that happened when multiple sessions update the same piece of data at the same time, and can terminate the source session that holds locks to restore blocked operations.
- DDL locks, also called metadata locks, are not included. You can view and analyze them on the Metadata Locks page.
- To view lock information of RDS for MySQL 8.0 instances, set performance_schema to ON. You can run the SHOW GLOBAL VARIABLES LIKE "performance_schema" command or refer to Modifying Parameters of an RDS for MySQL Instance to check the performance_schema settings.
Procedure
- Log in to the management console.
- Click in the upper left corner and select a region.
- Click in the upper left corner of the page and choose Databases > Relational Database Service.
- On the Instances page, click the DB instance name.
- In the navigation pane, choose DBA Assistant > Real-Time Diagnosis.
- Click the Locks & Transactions tab and enter the administrator password to log in to the database.
- On the Metadata Locks page, filter metadata locks by session ID, lock status, lock type, and database name.
Figure 1 Metadata Locks
- Check whether there are any sessions with metadata locks. If yes, select the sessions and click Kill Session.
- On the InnoDB Locks page, check whether there are any lock waits.
Figure 2 InnoDB Locks
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
The system is busy. Please try again later.
For any further questions, feel free to contact us through the chatbot.
Chatbot