cloudstack-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <>
Subject [jira] [Commented] (CLOUDSTACK-9595) Transactions are not getting retried in case of database deadlock errors
Date Thu, 24 Nov 2016 17:59:58 GMT


ASF GitHub Bot commented on CLOUDSTACK-9595:

Github user rafaelweingartner commented on the issue:
    @serg38 I have just now started reading this PR (excuse me if I overlooked some information).
    > If we are to try to implement a general way of dealing with deadlocks in ACS how
could it be done to ensure DB consistency and correct transaction retry?
    Answering your question; in my opinion, we should not “try” to implement a general
way of managing transactions. We are only having this type of problem because instead of using
a framework to manage access and transactions in databases, it was developed a module to do
that and incorporated to ACS; this means we have to maintain and live with this code. 
    Now, the problem is that it would be a Dantesque task to change the way ACS manages transactions
    I am with John on this one, retrying is not a good idea; it can hide problems, cause overheads
and cause even more headaches.  I think that the best approach is to deal with this type of
problem on the fly; this means, as John said, addressing them as bugs when they are reported.
    Having said that, I have not helped a bit to solve the problem… Let’s see if I can
be of any help. 
    I was reading the ticket #CLOUDSTACK-9595. It seems that the problem (reported there)
happened when a VM was being removed from a table “instance_group_vm_map”. I just do not
understand because the method called is “UserVmManagerImpl.addInstanceToGroup”. I am hoping
that this makes sense. Anyways…
    The MYSQL docs have the following on deadlocks:
    > A deadlock is a situation where different transactions are unable to proceed because
each holds a lock that the other needs
    This means, there was something else being executed when that VM was deleted/added, and
this caused the deadlock and the exception. Probably something else is using the table “instance_group_vm_map”.
    I think we should track these two tasks/processes that can cause the problem and work
them out, instead of looking for a generic way to deal with this situation. Maybe these processes
that are causing deadlock are locking tables that are not needed or executing some processing
that could be avoided or modified.
    Do we use case that can reproduce the problem? 

> Transactions are not getting retried in case of database deadlock errors
> ------------------------------------------------------------------------
>                 Key: CLOUDSTACK-9595
>                 URL:
>             Project: CloudStack
>          Issue Type: Bug
>      Security Level: Public(Anyone can view this level - this is the default.) 
>    Affects Versions: 4.8.0
>            Reporter: subhash yedugundla
>             Fix For: 4.8.1
> Customer is seeing occasional error 'Deadlock found when trying to get lock; try restarting
transaction' messages in their management server logs.  It happens regularly at least once
a day.  The following is the error seen 
> 2015-12-09 19:23:19,450 ERROR [cloud.api.ApiServer] (catalina-exec-3:ctx-f05c58fc ctx-39c17156
ctx-7becdf6e) unhandled exception executing api command: [Ljava.lang.String;@230a6e7f
> DB Exception on: com.mysql.jdbc.JDBC4PreparedStatement@74f134e3:
DELETE FROM instance_group_vm_map WHERE instance_group_vm_map.instance_id = 941374
> 	at
> 	at sun.reflect.GeneratedMethodAccessor360.invoke(Unknown Source)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(
> 	at java.lang.reflect.Method.invoke(
> 	at
> 	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(
> 	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(
> 	at
> 	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(
> 	at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(
> 	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(
> 	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(
> 	at com.sun.proxy.$Proxy237.expunge(Unknown Source)
> 	at$2.doInTransactionWithoutResult(
> 	at
> 	at$2.doInTransaction(
> 	at
> 	at
> 	at
> 	at

This message was sent by Atlassian JIRA

View raw message