Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-72055

Abruptly stopping node while project reindex is in progress causes inability to reindex Jira

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Medium Medium
    • None
    • 8.0.0, 7.6.15, 8.5.3, 7.13.18, 8.22.3, 9.12.2
    • Data Center - Index

      Issue Summary

      Abruptly stopping node while project reindex is in progress causes inability to reindex Jira.
      This problem is a more specific version of JRASERVER-47045

      Steps to Reproduce

      1. Run a project reindex on node 1
      2. Abruptly terminate Jira process on node 1
      3. On node 2, go to Jira settings > System > Indexing page

      Expected Results

      Upon visiting Indexing page on node 2, reindexing operations are available.

      Actual Results

      Re-indexing operations are not available. The following message is displayed:

      The 'Lock Jira and rebuild index' option is unavailable while other indexing operations are in progress. See the Jira log for more details.

      Workaround

      • If on Jira 8.5.4, 8.8.0 or higher, the stale task will get automatically removed within 30 minutes, that will self-resolve the problem (see - JRASERVER-66204)
      • Otherwise, restart the node that initiated the task, so the stale task gets cleared.
        • if it's hard to understand which node initiated the task, you can do a rolling restart.
      • Sometimes the node that initiated the task itself could be removed and a new node could be built in place. It was noticed then that rolling restart did not fix it. Looking at the indexing page where the greyed out option is shown, the logs would point out something as below, where node-172.89.34.555 is the node that has been removed.
      2024-06-04 17:30:05,938+0000 https-jsse-nio-8443-exec-61 url: /secure/admin/IndexAdmin.jspa, /secure/admin/jira/views/indexing.jsp; user: xxxxx INFO xxxx 1050x195x2 1e0pmmt 15.53.110.186 /secure/admin/IndexAdmin.jspa [c.a.j.w.a.admin.index.IndexAdminImpl] foreground re-index option is unavailable because of in-progress index task: TaskDescriptorImpl{taskId=229000, result=null, node=node-172.89.34.555, context=ProjectIndexTaskContext{projectId=39601, projectName='Danger', nodeId='node-172.89.34.555'}} 

      In that case utilize the scriptrunner script similar to JRASERVER-66722 like below to kill the stale task and remove from the cache in each node, to open it up for re-indexing.

      import com.atlassian.jira.component.ComponentAccessor
      import com.atlassian.jira.task.TaskManagerImpl
       
      def TaskManager = ComponentAccessor.getComponent(TaskManagerImpl)
      TaskManager.removeTask(xxxxxxx)
       

            Unassigned Unassigned
            mfilipan Marko Filipan
            Votes:
            11 Vote for this issue
            Watchers:
            19 Start watching this issue

              Created:
              Updated: