MySQL Backup Restore Fails with 'The total number of locks exceeds the lock table size' Exception


アトラシアン コミュニティをご利用ください。



Restoring a MySQL backup, fails with the following exception reported in the fisheye-debug-<date>.log:

INFO - Closing com.cenqua.fisheye.ctl.Restore$RestoreApplicationContext@3b0090a4<com.cenqua.fisheye.ctl.Restore$RestoreApplicationContext@3b0090a4[X]<com.cenqua.fisheye.ctl.Restore$RestoreApplicationContext@3b0090a4>>: startup date [Thu Jul 02 22:16:47 PDT 2015]; root of context hierarchy
INFO - *** application context closed *** Error talking to database: Problem with constraints script /data/fecru-3.7.0/sql/MYSQL/schema/constraints_89.sql
at com.atlassian.crucible.migration.item.SQLBackup.restore(
at com.atlassian.crucible.migration.item.SQLBackup$1.restore(
at com.cenqua.fisheye.ctl.Restore.main(
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
at java.lang.reflect.Method.invoke(
at com.cenqua.fisheye.FishEyeCtl.mainImpl(
at com.cenqua.fisheye.FishEyeCtl.main(
Caused by: com.cenqua.crucible.hibernate.CruDBException: Problem with constraints script /data/fecru-3.7.0/sql/MYSQL/schema/constraints_89.sql
at com.cenqua.crucible.hibernate.DefaultDBControl.addConstraints(
at com.atlassian.crucible.migration.item.DBImporter.importData(
at com.atlassian.crucible.migration.item.SQLBackup.restore(
... 9 more
Caused by: com.cenqua.crucible.hibernate.CruDBException: SQL script error on line 49: "alter table cru_fr_detail add index FK4F2200B487D2F44 (cru_revision_id), add constraint FK4F2200B487D2F44 foreign key (cru_revision_id) references cru_revision (cru_revision_id);"
(The total number of locks exceeds the lock table size), please contact
at com.cenqua.crucible.hibernate.DefaultDBControl.executeScript(
at com.cenqua.crucible.hibernate.DefaultDBControl.executeScript(
at com.cenqua.crucible.hibernate.DefaultDBControl.addConstraints(
... 11 more
Caused by: java.sql.SQLException: The total number of locks exceeds the lock table size
at com.mysql.jdbc.SQLError.createSQLException(
at com.mysql.jdbc.MysqlIO.checkErrorPacket(
at com.mysql.jdbc.MysqlIO.checkErrorPacket(
at com.mysql.jdbc.MysqlIO.sendCommand(
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(
at com.mysql.jdbc.ConnectionImpl.execSQL(
at com.mysql.jdbc.StatementImpl.executeUpdate(
at com.mysql.jdbc.StatementImpl.executeUpdate(
at com.cenqua.crucible.hibernate.DefaultDBControl.executeScript(
... 13 more
Restore failed. This may leave your target FISHEYE_INST directory (/opt/crucible/inst) in an inconsistent state.


This exception can occur when the innodb_buffer_pool_size MySQL variable is too small for the instance. InnoDB maintains a storage area called the buffer pool for caching data and indexes in memory. As per the MySQL documentation, this variable is:

Specifies the size of the buffer pool. If your buffer pool is small and you have sufficient memory, making the pool larger can improve performance by reducing the amount of disk I/O needed as queries access InnoDB tables. 

In MySQL InnoDB, row level locks are implemented by having special lock table, located in the buffer pool, where a small record is allocated for each hash and for each row locked on that page bit can be set. 

 As per this MySQL Forums query:

The SQL statement sets locks on all the records it scans. If you have a small buffer pool, then the InnoDB lock table may indeed grow so big that it does not fit in the buffer pool. 

Some more details about this can be found here:


Increase the value of the innodb_buffer_pool_size for the MySQL database and run the restore again.


最終更新日 2015 年 7 月 7 日


Powered by Confluence and Scroll Viewport.