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

While loading values for SLA CustomField getValueFromIssue method flushes EagerLoadingOfBizCustomFieldPersister cache

XMLWordPrintable

      Summary

      While loading CustomFields values for SLA fields getValueFromIssue() method flushes EagerLoadingOfBizCustomFieldPersister cache (it's used by whole Jira) for each SLA cache miss.
      Taking into account JSDSERVER-5681, that makes non-SD issues reindex also slow, since we do extra SQL calls.

      Environment

      • Jira Core
      • Jira ServiceDesk
      • Some number (50+) of Service Desk SLA CF
      • Large number (200+) of non Service Desk CF

      Steps to Reproduce

      1. Enable SQL logging and set com.atlassian.servicedesk.cache.sla.value to DEBUG
      2. Create non Service Desk issue
      3. Check logs

      Expected Results

      While loading CustomFields values EagerLoadingOfBizCustomFieldPersister is not flushed.

      Actual Results

      • you can see that during creating new KAN-8 (non-SD) issue, it's loading SLA value and also data from DB
        2018-03-08 17:15:36,645 http-nio-1762-exec-8 DEBUG admin 1035x464x1 hckbm2 0:0:0:0:0:0:0:1 /secure/QuickCreateIssue.jspa [c.a.s.cache.sla.value] For custom field id 'customfield_10423' for issue 'KAN-8' returning SLA value: null
        ...
        2018-03-08 17:15:36,667 http-nio-1762-exec-8 DEBUG admin 1035x464x1 hckbm2 0:0:0:0:0:0:0:1 /secure/QuickCreateIssue.jspa [c.a.s.cache.sla.value] For custom field id 'customfield_10422' for issue 'KAN-8' returning SLA value: null
        
      • Issue reindex time increases
      • Large number of SQL request to DB

      Notes

      • loadSLAValue() method flushes EagerLoadingOfBizCustomFieldPersister cache and then load all CF values from DB, example SQL:
        SELECT ID, ISSUE, CUSTOMFIELD, UPDATED, PARENTKEY, STRINGVALUE, NUMBERVALUE, TEXTVALUE, DATEVALUE, VALUETYPE FROM customfieldvalue WHERE ISSUE='1319406' ORDER BY UPDATED ASC, ID ASC
        
        • That means that potentially method do extra DB call for each SLA field, making reindexing slow.
      • Taking into account JSDSERVER-5681, that makes non-SD issues reindex also slow, since we do extra SQL calls (~ SLA CF)
      • So problem is multiplication of NumberOfIssues * NumberOfSLA * CostOfSQL

      Workaround

      None

              szaporozhtsev Sergey Zaporozhtsev (Inactive)
              ayakovlev@atlassian.com Andriy Yakovlev [Atlassian]
              Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: