Patch for possible inconsistencies in Indexation with JIRA 5.1.+

This notification should be usefull for any JIRA Administrator who had implemented or want to implement smart workflows.

By smart workflows, I think about Workflows :

Few days ago, I have raised an issue related the new way of JIRA Issue Indexation implemented since JIRA 5.1.

In few terms, the re-index Post-Function does not execute an Issue Indexation, but only send the request to the IndexManager which consumes the requests at the end of OSWorkflow transaction. In some Workflows configurations, these postponed indexations can lead to Indexation inconsistencies. (See details in JRA-33293).

Typical case is the usage of Auto-Action …
As soon as a Transition is qualified as an Auto Action, when OSWOrkflow engine executes it, it is in the same transaction of the initial transition, then each of their indexation request done by the native Re-Index Post-Function are queued and executed only at the end of the transaction. Due to the bug detailed in JRA-33293, the queue of issues to index is drained in a hazardous order, and you can see the Issue’s values of the 1st transition done in last position, and then have the index inconsistent against the value stored in database.

A workaround …
In order to avoid such inconsistencies, and waiting for a fix (perhaps a patch ?) from Atlassian, you can append the Post-Function “Indexation Forced Function” just after the “re-index function” for all incoming transitions to a Step where there are outgoing Auto-Action from this Step.

By example, with the following a Workflow :

  • Create > Open
  • Open > Triage 1 (Auto) > New
  • Open > Triage 2 (Auto) > New
  • New > Start Progress > In Progress
  • In Progress > Close Issue > Closed
  • Closed > Reopen > Open

Where Triage X (Auto) are transitions marked as Auto Action.

You will have to apply the workaround for the Create and Reopen transitions, since the both go to Open step where there are outgoing Auto Action..

Note that, you can encounter similar issue :

I think that we should be able to find other error cases …

Plugin Name Alkaes JIRA Plugin Indexation Forced
Plugin Id fr.alkaes.jira-plugin-index-forced
Plugin Version 1.0.0
Download from here

Good patch …
Alkaes Consulting

This entry was posted in Tips and Tricks. Bookmark the permalink.

One Response to Patch for possible inconsistencies in Indexation with JIRA 5.1.+

  1. Pingback: Minyaa Suite for JIRA 7.0.x (SNAPSHOT) | Minyaa

Leave a Reply