Uploaded image for project: 'Bamboo'
  1. Bamboo
  2. BAM-15472

If move plan operation is interrupted it can lead to data corruption

    Details

    • Last commented by user?:
      true
    • Comments:
      1

      Description

      Symptoms:

      2015-01-22 07:04:12,087 WARN [scheduler_Worker-10] [BuildResultsSummaryHibernateDao] Exception removing GH-BLT2 running 'delete from REPOSITORY_CHANGESET  where BUILDRESULTSUMMARY_ID in   (select BUILDRESULTSUMMARY_ID from BUILDRESULTSUMMARY where BUILDRESULTSUMMARY.BUILD_KEY = ?)'
      org.postgresql.util.PSQLException: ERROR: update or delete on table "repository_changeset" violates foreign key constraint "fk34a3e6e3cbadfcbd" on table "relevant_changesets"
        Detail: Key (repository_changeset_id)=(880903050) is still referenced from table "relevant_changesets".
      	at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2198)
      	at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1927)
      	at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:255)
      	at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:561)
      	at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:419)
      	at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:365)
      	at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeUpdate(NewProxyPreparedStatement.java:105)
      	at com.atlassian.bamboo.resultsummary.BuildResultsSummaryHibernateDao$13$1.call(BuildResultsSummaryHibernateDao.java:838)
      	at com.atlassian.bamboo.resultsummary.BuildResultsSummaryHibernateDao$13$1.call(BuildResultsSummaryHibernateDao.java:833)
      	at com.atlassian.bamboo.util.BambooProfilingUtils.withUtilTimerStack(BambooProfilingUtils.java:51)
      	at com.atlassian.bamboo.resultsummary.BuildResultsSummaryHibernateDao$13.executeQuery(BuildResultsSummaryHibernateDao.java:832)
      	at com.atlassian.bamboo.resultsummary.BuildResultsSummaryHibernateDao$13.execute(BuildResultsSummaryHibernateDao.java:817)
      	at org.hibernate.impl.SessionImpl.doWork(SessionImpl.java:1997)
      	at com.atlassian.bamboo.persistence.BambooTransactionHibernateTemplate$2.doInHibernate(BambooTransactionHibernateTemplate.java:66)
      	at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:411)
      	at org.springframework.orm.hibernate3.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:379)
      	at com.atlassian.bamboo.persistence.BambooTransactionHibernateTemplate$1.doInTransaction(BambooTransactionHibernateTemplate.java:52)
      	at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133)
      	at com.atlassian.bamboo.persistence.BambooTransactionHibernateTemplate.execute(BambooTransactionHibernateTemplate.java:41)
      	at com.atlassian.bamboo.persistence.BambooTransactionHibernateTemplate.execute(BambooTransactionHibernateTemplate.java:47)
      	at com.atlassian.bamboo.persistence.BambooTransactionHibernateTemplate.doWork(BambooTransactionHibernateTemplate.java:60)
      	at com.atlassian.bamboo.resultsummary.BuildResultsSummaryHibernateDao.removeResultsSummariesForPlanExecuteQuery(BuildResultsSummaryHibernateDao.java:812)
      	at com.atlassian.bamboo.resultsummary.BuildResultsSummaryHibernateDao.removeResultsSummaries(BuildResultsSummaryHibernateDao.java:796)
      	at com.atlassian.bamboo.resultsummary.BuildResultsSummaryHibernateDao.removeResultsSummariesForPlan(BuildResultsSummaryHibernateDao.java:625)
      	at com.atlassian.bamboo.resultsummary.BuildResultsSummaryManagerImpl.removeResultsForPlan(BuildResultsSummaryManagerImpl.java:1318)
      	at com.atlassian.bamboo.resultsummary.BuildResultsSummaryManagerImpl.removeAllOrphanedResultSummaries(BuildResultsSummaryManagerImpl.java:1290)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:606)
      	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
      	at com.atlassian.bamboo.security.acegi.intercept.aopalliance.AuthorityOverrideMethodSecurityInterceptor.invoke(AuthorityOverrideMethodSecurityInterceptor.java:30)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
      	at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:98)
      	at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:262)
      	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:95)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
      	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)
      	at com.sun.proxy.$Proxy76.removeAllOrphanedResultSummaries(Unknown Source)
      	at com.atlassian.bamboo.deletion.DeletionServiceImpl.removeOrphanedBuildResults(DeletionServiceImpl.java:479)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:606)
      	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
      	at com.atlassian.bamboo.security.acegi.intercept.aopalliance.AuthorityOverrideMethodSecurityInterceptor.invoke(AuthorityOverrideMethodSecurityInterceptor.java:30)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
      	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)
      	at com.sun.proxy.$Proxy176.removeOrphanedBuildResults(Unknown Source)
      	at com.atlassian.bamboo.deletion.OrphanedBuildResultRemovalJob.execute(OrphanedBuildResultRemovalJob.java:27)
      	at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
      	at com.atlassian.bamboo.utils.BambooRunnables$1.run(BambooRunnables.java:49)
      	at com.atlassian.bamboo.security.ImpersonationHelper.runWith(ImpersonationHelper.java:31)
      	at com.atlassian.bamboo.security.ImpersonationHelper.runWithSystemAuthority(ImpersonationHelper.java:20)
      	at com.atlassian.bamboo.security.ImpersonationHelper$1.run(ImpersonationHelper.java:52)
      	at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:525)
      Caused by: org.postgresql.util.PSQLException: ERROR: update or delete on table "repository_changeset" violates foreign key constraint "fk34a3e6e3cbadfcbd" on table "relevant_changesets"
        Detail: Key (repository_changeset_id)=(880903050) is still referenced from table "relevant_changesets".
      	at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2198)
      	at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1927)
      	at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:255)
      	at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:561)
      	at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:419)
      	at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:365)
      	at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeUpdate(NewProxyPreparedStatement.java:105)
      	at com.atlassian.bamboo.resultsummary.BuildResultsSummaryHibernateDao$13$1.call(BuildResultsSummaryHibernateDao.java:838)
      	at com.atlassian.bamboo.resultsummary.BuildResultsSummaryHibernateDao$13$1.call(BuildResultsSummaryHibernateDao.java:833)
      	at com.atlassian.bamboo.util.BambooProfilingUtils.withUtilTimerStack(BambooProfilingUtils.java:51)
      	at com.atlassian.bamboo.resultsummary.BuildResultsSummaryHibernateDao$13.executeQuery(BuildResultsSummaryHibernateDao.java:832)
      	... 49 more
      

      Seen on JBAC during the upgrade to 5.8-m3.0.

      The root cause is that plan key change wasn't completed correctly leaving part of the results in 'orpaned' state.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Last commented:
                  2 years, 7 weeks, 4 days ago