Indexing events improvements

XMLWordPrintable

    • 0
    • 1

      In Structure app, we need to closely monitor the Lucene index, especially in DC environment. The following suggestions are based on specific problems that we experienced and for which we had to invent complex and fragile workarounds.

      1. It is important to have either finish or cancel event for each start event. There is no such guarantee at the moment: ReindexAllCompletedEvent/ReindexAllCancelledEvent may be not fired at the end of reindexing.
        // Jira 7.5.0 src: com.atlassian.jira.issue.index.reIndexAll() lines 328-330
        ...
        } else if (!withReindexLock(() -> doStopTheWorldReindex(context, filterReindexAllIndexingParams))) {
        return -1;
        }
        ...
      2. ReindexIssuesCompletedEvent does not have a list of the issues that were reindexed. It seems to be simple to implement. We need this in the Data Center environment because we need to know when we can safely run Lucene queries after an issue is changed on a different node.
      3. It would be great to have project reindex events (started/completed/cancelled). Our app, as many other apps and Jira itself, prefer to use index due to performance reasons. Project reindex process changes indices that can affect data calculation results in the app, so we have to handle this to clear caches. Currently the only way to know about project reindex is to find corresponting task in the task manager.
      4. It is reasonable to expect that when you get an issue change event, the corresponding index has already been updated. The current implementation of com.atlassian.jira.event.listeners.search.IssueIndexListener is simply an IssueEventListener implementation. It means that it can be called before or after any other listener. So some of the listeners will see the index updated while others will not. This is because event listeners are called according to their position in the issue event class hierarchy. I suggest to treat IssueIndexListener as an exception and notify it first, before other liisteners.

      Thanks!
       

              Assignee:
              Unassigned
              Reporter:
              Alexey Stepanov [ALM Works]
              Votes:
              9 Vote for this issue
              Watchers:
              11 Start watching this issue

                Created:
                Updated: