Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-68168

Make FieldLayoutCache population more efficient in Jira

    XMLWordPrintable

Details

    • 36
    • 4
    • We collect Jira feedback from various sources, and we evaluate what we've collected when planning our product roadmap. To understand how this piece of feedback will be reviewed, see our Implementation of New Features Policy.

    Description

      Summary

      JIRA inefficiently populates fieldLayoutCache due to slow loading and large size of FieldLayoutItems. JIRA loads elements into fieldLayoutCache by FIELDLAYOUT and at the same time load all related rows from FieldLayoutItem table.
      See related ticket for context JRASERVER-66013.

      Since fieldLayoutCache is used in many places, slow population will cause performance problems, see for example: JRASERVER-29310 and JRASERVER-61166.

      Environment

      • Large number of rows in fieldlayoutitem table - 200k+:
         select count(1) from fieldlayoutitem; 
        1355666
        

      Expected Results

      Population of fieldLayoutCache is fast

      Actual Results

      Population of fieldLayoutCache is slow.

      Note

      • SQL logs will have the following:
        SELECT ID, FIELDLAYOUT, FIELDIDENTIFIER, DESCRIPTION, VERTICALPOSITION, ISHIDDEN, ISREQUIRED, RENDERERTYPE FROM public.fieldlayoutitem WHERE FIELDLAYOUT='10100'"
        
      • Stack-trace of the long running thread will be similar to this:
        ...
        	at com.atlassian.jira.issue.fields.layout.field.AbstractFieldLayoutManager.getRelevantFieldLayout(AbstractFieldLayoutManager.java:264)
        	at com.atlassian.jira.issue.fields.layout.field.DefaultFieldLayoutManager.getFieldLayout(DefaultFieldLayoutManager.java:702)
        	at com.atlassian.jira.issue.fields.layout.field.DefaultFieldLayoutManager.getUniqueFieldLayouts(DefaultFieldLayoutManager.java:586)
        	at com.atlassian.jira.issue.fields.layout.field.DefaultFieldLayoutManager.getUniqueFieldLayouts(DefaultFieldLayoutManager.java:562)
        	at com.atlassian.jira.issue.fields.DefaultFieldManager.findVisibleFieldLayouts(DefaultFieldManager.java:503)
        	at com.atlassian.jira.issue.fields.DefaultFieldManager.getUniqueSchemes(DefaultFieldManager.java:419)
        ...
        
      • Other action might also flush fieldLayoutCache, some examples (not limited to that):
        • Add issue type - /secure/admin/AddIssueType.jspa
        • Remove issue type - /secure/admin/DeleteIssueType.jspa
        • Add issue type scheme - /secure/admin/ConfigureOptionSchemes.jspa
        • Remove issue type scheme - /secure/admin/DeleteOptionScheme.jspa

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              ayakovlev@atlassian.com Andriy Yakovlev [Atlassian]
              Votes:
              30 Vote for this issue
              Watchers:
              30 Start watching this issue

              Dates

                Created:
                Updated: