Request Type Cache Invalidation when Dynamic Fields are removed from Create Issue Screen

XMLWordPrintable

    • Severity 2 - Major
    • 16

      Summary

      Starting in JIRA 7.4.0/JSD 3.6.0, a new Request Type Cache was introduced, which helped improve the performance of various parts of JIRA Service Desk which were originally more database intensive. This cache is invalidated in certain circumstances; generally when changes are made to JIRA's Issue Types or Request Types, just for example.

      One specific circumstance where the cache would be invalidated and rebuilt would be when a field is present on a Request Type, where that same field is not present on the Create Issue Screen associated with that Request Type's Issue Type and Project. This marks the field as an Obsolete field, which JIRA will be able to repair by removing the field off of the Request Type.

       This logic does not work properly if a dynamic field (such as JIRA Service Desk's Organizations field) is being treated as an Obsolete field. If Organizations is removed off of the Create Issue Screen associated with the Request Type, JIRA will invalidate the Request Type Cache and attempt to repair the Request Type by removing Organizations, which is not possible.

      This will cause JIRA to always try to invalidate the cache upon loading the Customer Portal or accessing the Request Type in question, leading to excessive database calls as the cache is rebuilt over and over again. This can lead to performance issues (e.g. Slow Loading Customer Portals) in larger environments, or in environments where there are very many Request Types.

      Environment

      • JIRA 7.4.0+/JSD 3.6.0+

      Steps to Reproduce

      1. Install a brand new JIRA 7.4.0/JSD 3.6.0 instance
      2. Create at least two new JIRA Service Desk projects (i.e. JSD1, and JSD2, both Basic Service Desks)
      3. From the Customer Portal, create a new Request for yourself in JSD1 (i.e. IT Help)
      4. Remove Organizations from JSD1's screen associated with the Create Issue operation
      5. Enable SQL Logging
      6. Add DEBUG Logging for both of the following packages
        • com.atlassian.servicedesk.internal.feature.customer.request.requesttype.RequestTypeInternalCacheInvalidator
        • com.atlassian.servicedesk.plugins.base.internal.cache.CacheFactoryManagerImpl

       Finally, access $JIRA_URL/servicedesk/customer/portals.

      Expected Results

      No cache invalidation occurs.

      Actual Results

      Cache invalidation is observed from either atlassian-jira.log or Tomcat's catalina.out/stdout logs:

      2017-11-19 10:32:49,903 http-nio-9013-exec-25 DEBUG kliou 632x767x1 g39lf3 0:0:0:0:0:0:0:1 /rest/servicedesk/1/customer/models [c.a.s.i.f.c.request.requesttype.RequestTypeInternalCacheInvalidator] Invalidating 1 Request Type cache references
      2017-11-19 10:32:49,903 http-nio-9013-exec-25 DEBUG kliou 632x767x1 g39lf3 0:0:0:0:0:0:0:1 /rest/servicedesk/1/customer/models [c.a.s.i.f.c.request.requesttype.RequestTypeInternalCacheInvalidator] Done invalidating Request Type cache references
      2017-11-19 10:32:49,903 http-nio-9013-exec-25 DEBUG kliou 632x767x1 g39lf3 0:0:0:0:0:0:0:1 /rest/servicedesk/1/customer/models [c.a.s.i.f.c.request.requesttype.RequestTypeInternalCacheInvalidator] Invalidating 14 Request Type caches
      2017-11-19 10:32:49,903 http-nio-9013-exec-25 DEBUG kliou 632x767x1 g39lf3 0:0:0:0:0:0:0:1 /rest/servicedesk/1/customer/models [c.a.s.i.f.c.request.requesttype.RequestTypeInternalCacheInvalidator] Done invalidating Request Type caches
      2017-11-19 10:32:49,916 http-nio-9013-exec-25 DEBUG kliou 632x767x1 g39lf3 0:0:0:0:0:0:0:1 /rest/servicedesk/1/customer/models [c.a.s.i.f.c.request.requesttype.RequestTypeInternalCacheInvalidator] Invalidating 1 Request Type cache references
      2017-11-19 10:32:49,916 http-nio-9013-exec-25 DEBUG kliou 632x767x1 g39lf3 0:0:0:0:0:0:0:1 /rest/servicedesk/1/customer/models [c.a.s.i.f.c.request.requesttype.RequestTypeInternalCacheInvalidator] Done invalidating Request Type cache references
      2017-11-19 10:32:49,916 http-nio-9013-exec-25 DEBUG kliou 632x767x1 g39lf3 0:0:0:0:0:0:0:1 /rest/servicedesk/1/customer/models [c.a.s.i.f.c.request.requesttype.RequestTypeInternalCacheInvalidator] Invalidating 14 Request Type caches
      2017-11-19 10:32:49,916 http-nio-9013-exec-25 DEBUG kliou 632x767x1 g39lf3 0:0:0:0:0:0:0:1 /rest/servicedesk/1/customer/models [c.a.s.i.f.c.request.requesttype.RequestTypeInternalCacheInvalidator] Done invalidating Request Type caches

      Excessive SQL queries are observed in atlassian-jira-sql.log, when compared to when Organizations is not removed from the screen

      Workaround

      Add the Organizations field back to all affected Request Type's Create Issue screens.

            Assignee:
            Matthew McMahon (Inactive)
            Reporter:
            Kevin Liou
            Votes:
            5 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:
              Resolved: