Bug #2832

MySQL reports deadlock error

Added by Carlos Martín about 7 years ago. Updated over 6 years ago.

Status:ClosedStart date:04/10/2014
Priority:NormalDue date:
Assignee:Carlos Martín% Done:

0%

Category:Core & System
Target version:Release 4.10
Resolution:fixed Pull request:
Affected Versions:OpenNebula 4.4

Description

As reported in the mailing list: http://lists.opennebula.org/pipermail/users-opennebula.org/2014-April/027079.html


Thu Apr 10 16:07:40 2014 [ONE][E]: SQL command was: REPLACE INTO datastore_pool (oid, name, body, uid, gid, owner_u, group_u, other_u, cid) VALUES (108,'System 3','<DATASTORE><ID>108</ID><UID>0</UID><GID>0</GID><UNAME>oneadmin</UNAME><GNAME>oneadmin</GNAME><NAME>System 3</NAME><PERMISSIONS><OWNER_U>1</OWNER_U><OWNER_M>1</OWNER_M><OWNER_A>0</OWNER_A><GROUP_U>1</GROUP_U><GROUP_M>1</GROUP_M><GROUP_A>0</GROUP_A><OTHER_U>1</OTHER_U><OTHER_M>0</OTHER_M><OTHER_A>0</OTHER_A></PERMISSIONS><DS_MAD>-</DS_MAD><TM_MAD>qcow2</TM_MAD><BASE_PATH>/mnt/one_system_3/108</BASE_PATH><TYPE>1</TYPE><DISK_TYPE>0</DISK_TYPE><CLUSTER_ID>100</CLUSTER_ID><CLUSTER>KVM cluster</CLUSTER><TOTAL_MB>551263</TOTAL_MB><FREE_MB>429572</FREE_MB><USED_MB>93492</USED_MB><IMAGES></IMAGES><TEMPLATE><SHARED><![CDATA[YES]]></SHARED><TM_MAD><![CDATA[qcow2]]></TM_MAD><TYPE><![CDATA[SYSTEM_DS]]></TYPE></TEMPLATE></DATASTORE>',0,0,1,1,1,100), error 1213 : Deadlock found when trying to get lock; try restarting transaction
Thu Apr 10 16:10:25 2014 [ImM][I]: --Mark--
Thu Apr 10 16:13:18 2014 [VMM][I]: --Mark--
Thu Apr 10 16:13:31 2014 [InM][I]: --Mark--
Thu Apr 10 16:17:10 2014 [ONE][E]: SQL command was: REPLACE INTO host_pool (oid, name, body, state, last_mon_time, uid, gid, owner_u, group_u, other_u, cid) VALUES (12,'mess09-node','<HOST><ID>12</ID><NAME>mess09-node</NAME><STATE>2</STATE><IM_MAD>kvm</IM_MAD><VM_MAD>kvm</VM_MAD><VN_MAD>dummy</VN_MAD><LAST_MON_TIME>1397139430</LAST_MON_TIME><CLUSTER_ID>100</CLUSTER_ID><CLUSTER>KVM cluster</CLUSTER><HOST_SHARE><DISK_USAGE>0</DISK_USAGE><MEM_USAGE>16777216</MEM_USAGE><CPU_USAGE>210</CPU_USAGE><MAX_DISK>100794</MAX_DISK><MAX_MEM>19717932</MAX_MEM><MAX_CPU>1600</MAX_CPU><FREE_DISK>84193</FREE_DISK><FREE_MEM>15324609</FREE_MEM><FREE_CPU>1588</FREE_CPU><USED_DISK>1911123</USED_DISK><USED_MEM>4393324</USED_MEM><USED_CPU>11</USED_CPU><RUNNING_VMS>6</RUNNING_VMS><DATASTORES><DS><FREE_MB><![CDATA[84193]]></FREE_MB><ID><![CDATA[109]]></ID><TOTAL_MB><![CDATA[100794]]></TOTAL_MB><USED_MB><![CDATA[1]]></USED_MB></DS><DS><FREE_MB><![CDATA[420666]]></FREE_MB><ID><![CDATA[110]]></ID><TOTAL_MB><![CDATA[2064246]]></TOTAL_MB><USED_MB><![CDATA[1]]></U SED_MB></DS></DATASTORES></HOST_SHARE><VMS><ID>4805</ID><ID>5152</ID><ID>12575</ID><ID>13260</ID><ID>13358</ID><ID>21240</ID></VMS><TEMPLATE><ARCH><![CDATA[x86_64]]></ARCH><CPUSPEED><![CDATA[2266]]></CPUSPEED><HOSTNAME><![CDATA[mess09]]></HOSTNAME><HYPERVISOR><![CDATA[kvm]]></HYPERVISOR><MODELNAME><![CDATA[Intel(R) Xeon(R) CPU           E5520  @ 2.27GHz]]></MODELNAME><NETRX><![CDATA[136264617591]]></NETRX><NETTX><![CDATA[198812810614]]></NETTX><VERSION><![CDATA[4.4.0]]></VERSION></TEMPLATE></HOST>',2,1397139430,0,0,1,0,0,100), error 1213 : Deadlock found when trying to get lock; try restarting transaction
Thu Apr 10 16:19:46 2014 [ImM][I]: --Mark--
Thu Apr 10 16:21:10 2014 [ONE][E]: SQL command was: REPLACE INTO datastore_pool (oid, name, body, uid, gid, owner_u, group_u, other_u, cid) VALUES (108,'System 3','<DATASTORE><ID>108</ID><UID>0</UID><GID>0</GID><UNAME>oneadmin</UNAME><GNAME>oneadmin</GNAME><NAME>System 3</NAME><PERMISSIONS><OWNER_U>1</OWNER_U><OWNER_M>1</OWNER_M><OWNER_A>0</OWNER_A><GROUP_U>1</GROUP_U><GROUP_M>1</GROUP_M><GROUP_A>0</GROUP_A><OTHER_U>1</OTHER_U><OTHER_M>0</OTHER_M><OTHER_A>0</OTHER_A></PERMISSIONS><DS_MAD>-</DS_MAD><TM_MAD>qcow2</TM_MAD><BASE_PATH>/mnt/one_system_3/108</BASE_PATH><TYPE>1</TYPE><DISK_TYPE>0</DISK_TYPE><CLUSTER_ID>100</CLUSTER_ID><CLUSTER>KVM cluster</CLUSTER><TOTAL_MB>551263</TOTAL_MB><FREE_MB>429567</FREE_MB><USED_MB>93497</USED_MB><IMAGES></IMAGES><TEMPLATE><SHARED><![CDATA[YES]]></SHARED><TM_MAD><![CDATA[qcow2]]></TM_MAD><TYPE><![CDATA[SYSTEM_DS]]></TYPE></TEMPLATE></DATASTORE>',0,0,1,1,1,100), error 1213 : Deadlock found when trying to get lock; try restarting transaction

History

#1 Updated by Ruben S. Montero about 7 years ago

  • Status changed from New to Closed
  • Resolution set to worksforme

This deadlocks are usually related to DB size and can be solved tunning MySQL e.g. optimize DB tables... Will close this as a worksforme and reopen it in case this error shows up again

#2 Updated by Ruben S. Montero almost 7 years ago

  • Target version changed from Release 4.8 to Release 4.10

Errors may occur with innoDB engine. This issue is to produce the optimal queries/configurations to prevent the deadlocks.

The issue seems to occur when inserting the monitoring data, as multiple threads maybe using different mysql sessions.

#3 Updated by Ruben S. Montero over 6 years ago

  • Status changed from Closed to New
  • Resolution deleted (worksforme)

#4 Updated by Ruben S. Montero over 6 years ago

  • Assignee set to Carlos Martín

#5 Updated by Carlos Martín over 6 years ago

  • Status changed from New to Closed
  • Resolution set to fixed

Also available in: Atom PDF