[ 
https://issues.apache.org/jira/browse/CLOUDSTACK-2486?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13657472#comment-13657472
 ] 

Prachi Damle commented on CLOUDSTACK-2486:
------------------------------------------


2011-12-19 11:33:10,811 WARN [cloud.resource.ResourceManagerImpl] 
(AgentTaskPool-2:null) Unable to connect due to
com.cloud.utils.exception.CloudRuntimeException: DB Exception on: 
org.apache.commons.dbcp.DelegatingPreparedStatement@2e7fee2d
        at com.cloud.utils.db.GenericDaoBase.persist(GenericDaoBase.java:1309)
        at 
com.cloud.utils.db.DatabaseCallback.intercept(DatabaseCallback.java:35)
        at 
com.cloud.host.dao.HostDetailsDaoImpl.persist(HostDetailsDaoImpl.java:91)
        at 
com.cloud.utils.db.DatabaseCallback.intercept(DatabaseCallback.java:35)
        at com.cloud.host.dao.HostDaoImpl.saveDetails(HostDaoImpl.java:469)
        at com.cloud.host.dao.HostDaoImpl.update(HostDaoImpl.java:519)
        at 
com.cloud.utils.db.DatabaseCallback.intercept(DatabaseCallback.java:35)
        at com.cloud.host.dao.HostDaoImpl.update(HostDaoImpl.java:64)
        at 
com.cloud.resource.ResourceManagerImpl.createHostVO(ResourceManagerImpl.java:1453)
        at 
com.cloud.resource.ResourceManagerImpl.createHostAndAgent(ResourceManagerImpl.java:1502)
        at 
com.cloud.resource.ResourceManagerImpl.createHostAndAgent(ResourceManagerImpl.java:1530)
        at 
com.cloud.agent.manager.AgentManagerImpl$SimulateStartTask.run(AgentManagerImpl.java:1134)
        at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
        at java.lang.Thread.run(Thread.java:636)
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLTransactionRollbackException: 
Deadlock found when trying to get lock; try restarting transaction
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at 
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
        at 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
        at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
        at com.mysql.jdbc.Util.getInstance(Util.java:381)
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1045)
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3515)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3447)
        at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1951)
        at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2101)
        at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2554)
        at 
com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1761)
        at 
com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2046)
        at 
com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1964)
        at 
com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1949)
        at 
org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:101)
        at com.cloud.utils.db.GenericDaoBase.persist(GenericDaoBase.java:1272)
        ... 26 more
2011-12-19 11:33:22,992 DEBUG [cloud.resource.ResourceState] 
(AgentTaskPool-1:null) Resource state update: [id = 1; name = 10.223.50.7; old 
state = Enabled; event = InternalCreated; new state = Enabled]
2011-12-19 11:33:22,992 DEBUG [cloud.host.Status] (AgentTaskPool-1:null) 
Transition:[Resource state = Enabled, Agent event = AgentConnected, Host id = 
1, name = 10.223.50.7]
2011-12-19 11:33:23,479 DEBUG [cloud.host.Status] (AgentTaskPool-1:null) Agent 
status update: [id = 1; name = 10.223.50.7; old status = Disconnected; event = 
AgentConnected; new status = Connecting; old update count = 37; new update 
count = 38] 
                
> Deleting the host_details and inserting them back can lead to mysql deadlock
> ----------------------------------------------------------------------------
>
>                 Key: CLOUDSTACK-2486
>                 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-2486
>             Project: CloudStack
>          Issue Type: Bug
>      Security Level: Public(Anyone can view this level - this is the 
> default.) 
>          Components: Management Server
>    Affects Versions: 4.2.0
>            Reporter: Prachi Damle
>            Assignee: Prachi Damle
>
> When host tries to connect to management server, the old host_details are 
> deleted and new records are inserted. MySQL deadlock is seen sometimes during 
> this delete and insert on the same table. If this error happens, host 
> connection fails.
> a) This issue is intermittent issue seen with MySQL. It seems to happen when 
> we are deleting and inserting records in the same table in one transaction.
> b)CS auto-corrects this error state:
> CloudStack has host connection 'retry' mechanism where we try to connect back 
> to the host. This retry mechanism corrects this issue because the DB issue is 
> intermittent and eventually the hosts connect back.
> Hence this does not affect the CS functionality. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to