MySQL Common errors

Source: Internet
Author: User

Lock wait timeout exceeded; Try restarting transaction some information

1.

Lock wait timed out. is caused by the current transaction waiting for other transactions to release the lock resource. You can find out the tables and statements of the lock resource competition, optimize your SQL, create indexes, etc., and if not, you can reduce the number of concurrent threads appropriately.


2.

Your transaction timed out waiting for a lock on a table, and it is estimated that the table is being locked by another process and has not been released.

can use SHOW INNODB status/g; Look at the lock situation.

3. Search and solve the problem

On the Management node [NDBD default]

Area Plus:

transactiondeadlockdetectiontimeout=10000 (set to 10 seconds) is 1200 (1.2 seconds) by default

4.

The InnoDB automatically detects deadlocks for rollback, or terminates deadlock situations.

Reference

InnoDB automatically detects transaction deadlocks and rolls back a transaction or transactions to break the deadlock.

InnoDB tries to pick small transactions to roll back, where the size of a transaction are determined by the number of rows Inserted, updated, or deleted.

If the parameter is Innodb_table_locks=1 and autocommit=0, InnoDB will be aware of the deadlock on the table and the row-level lock at the MySQL level. In addition, InnoDB does not detect the MySQL lock tables command and other storage engine deadlocks.

You should set Innodb_lock_wait_timeout to resolve this situation.

Innodb_lock_wait_timeout is the time-out for InnoDB to discard row-level locks.


MySQL Common errors

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.