Jira Charting Plugin is unsafe for use in Data Center environments as it may cause a deadlock in the database when multiple nodes attempt perform CF updates

Description

Summary

Jira Charting Plugin may cause a deadlock in the database when multiple nodes attempt to perform CF updates

Steps to Reproduce

The issue manifests when the following scenario occurs:

  • An issue operation is performed to an issue on Node A

  • Node A replicates the index operation to Node B and Node C

  • Node B and Node C attempts to reindex the issue simultaneously

    • Reindexing an issue when the Jira Charting Plugin is installed will reindex the Time in Status Custom Field, causing it to recalculate, so that the recalculated value may be written into the node's index. This recalculation begins with a deletion to the custom field's value in the database.

  • The same delete statement is made to the database's customfieldvalue table from multiple nodes, resulting in a deadlock

Notes

NodeReindexServiceThread thread shows a stack trace similar to the following:

 

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 "NodeReindexServiceThread:thread-1" prio=5 tid=0x000000000000015f nid=0 runnable java.lang.Thread.State: RUNNABLE at java.net.SocketInputStream.socketRead0(Native Method) at java.net.SocketInputStream.socketRead(SocketInputStream.java:116) at java.net.SocketInputStream.read(SocketInputStream.java:171) at java.net.SocketInputStream.read(SocketInputStream.java:141) ... at com.sun.proxy.$Proxy390.updateValues(Unknown Source) at com.atlassian.jira.ext.charting.field.TimeInStatusCFType.storeDatabaseValue(TimeInStatusCFType.java:98) at com.atlassian.jira.ext.charting.field.TimeInStatusCFType.getValueFromIssue(TimeInStatusCFType.java:77) at com.atlassian.jira.issue.fields.ImmutableCustomField.getValue(ImmutableCustomField.java:350) ... at com.sun.proxy.$Proxy41.reIndexIssueObjects(Unknown Source) at com.atlassian.jira.index.ha.DefaultNodeReindexService.updateIssueIndex(DefaultNodeReindexService.java:453) at com.atlassian.jira.index.ha.DefaultNodeReindexService.updateAffectedIndexes(DefaultNodeReindexService.java:341) at com.atlassian.jira.index.ha.DefaultNodeReindexService.applyIndexOperations(DefaultNodeReindexService.java:279) at com.atlassian.jira.index.ha.DefaultNodeReindexService.reIndex(DefaultNodeReindexService.java:265) ... at java.lang.Thread.run(Thread.java:748)

 

Data from Cluster Index Replication health check fails in Jira Data Center due to Jira Charting Plugin]

 

 

Environment

None

Testing Notes

None

Status

Assignee

Unassigned

Reporter

Andriy Yakovlev

Labels

None

Add-on Type

Server

Team

None

CC

None

Risk factor

None

QA Kickoff Status

None

QA Demo Status

None

Affects versions

3.0

Priority

Major