Uploaded image for project: 'Jira Service Management Data Center'
  1. Jira Service Management Data Center
  2. JSDSERVER-14014

Corruption when deleting objects from Assets prevents reindexing

XMLWordPrintable

      Issue Summary

      This is reproducible on Data Center: (yes)

      Steps to Reproduce

      1. Delete objects
      2. Attempt reindex

      Note, this has not been reproduced.

      Expected Results

      Delete works as expected and reindexing works

      Actual Results

      Unable to reindex

      The below exception is thrown in the atlassian-jira.log file when deleting:

          org.postgresql.util.PSQLException: ERROR: update or delete on table "AO_8542F1_IFJ_OBJ" violates foreign key constraint "fk_ao_8542f1_ifj_obj_jiraissue_object_id" on table "AO_8542F1_IFJ_OBJ_JIRAISSUE"
            Detail: Key (ID)=(11111) is still referenced from table "AO_8542F1_IFJ_OBJ_JIRAISSUE".
      	at com.atlassian.activeobjects.internal.EntityManagedActiveObjects.delete(EntityManagedActiveObjects.java:120) [?:?]
      	at com.atlassian.activeobjects.osgi.TenantAwareActiveObjects.delete(TenantAwareActiveObjects.java:282) [?:?]
      	at jdk.internal.reflect.GeneratedMethodAccessor1597.invoke(Unknown Source) [?:?]
      	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) [?:?]
      	at java.base/java.lang.reflect.Method.invoke(Unknown Source) [?:?]
      at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-util.jar:8.5.78]
      	at java.base/java.lang.Thread.run(Unknown Source) [?:?]
      Caused by: org.postgresql.util.PSQLException: ERROR: update or delete on table "AO_8542F1_IFJ_OBJ" violates foreign key constraint "fk_ao_8542f1_ifj_obj_jiraissue_object_id" on table "AO_8542F1_IFJ_OBJ_JIRAISSUE"
            Detail: Key (ID)=(11111) is still referenced from table "AO_8542F1_IFJ_OBJ_JIRAISSUE".
      	at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2552) [postgresql-42.2.23.jar:42.2.23]
      	at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2284) [postgresql-42.2.23.jar:42.2.23] 

      When attempting reindex, we can see errors like

      /rest/insight/1.0/index/reindex/start  [i.r.i.index.model.ObjectIndexImpl] Index not completed successfully. objectIds: ...
      com.google.common.cache.CacheLoader$InvalidCacheLoadException: loadAll failed to return a value for 123456
      	at com.google.common.cache.LocalCache.getAll(LocalCache.java:4025) [guava-26.0-jre.jar:?]
      	at com.google.common.cache.LocalCache$LocalLoadingCache.getAll(LocalCache.java:4972) [guava-26.0-jre.jar:?]
      	at io.riada.insight.index.model.InsightIndexBase.loadAll(InsightIndexBase.java:81) [insight-9.1.11_1659471044777.jar:?]
      	at io.riada.insight.index.model.ObjectIndexImpl.reindexObjects(ObjectIndexImpl.java:318) [insight-9.1.11_1659471044777.jar:?]
      	at com.riadalabs.jira.plugins.insight.services.core.index.ReindexServiceImpl$ReindexObjectsJob.executeTask(ReindexServiceImpl.java:526) [insight-9.1.11_1659471044777.jar:?]
      	at com.riadalabs.jira.plugins.insight.services.core.index.ReindexServiceImpl$ReindexObjectsJob.executeTask(ReindexServiceImpl.java:503) [insight-9.1.11_1659471044777.jar:?]
      	at com.riadalabs.jira.plugins.insight.services.core.multithreadservice.InsightServiceJob.call(InsightServiceJob.java:42) [insight-9.1.11_1659471044777.jar:?]
      	at com.atlassian.sal.core.executor.ThreadLocalDelegateCallable.call(ThreadLocalDelegateCallable.java:38) [jira-sal-plugin-8.20.11_1658253878000.jar:?]
      	at java.base/java.util.concurrent.FutureTask.run(Unknown Source) [?:?]
      	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:?]
      	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:?]
      	at java.base/java.lang.Thread.run(Unknown Source) [?:?]

      Workaround

      The issue can be resolved with the following help articles

              c8bcca445054 Benjamin Suess
              c8bcca445054 Benjamin Suess
              Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: