Make FieldLayoutCache population more efficient in Jira

XMLWordPrintable

    • 13
    • 37

      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

            Assignee:
            Unassigned
            Reporter:
            Andriy Yakovlev [Atlassian]
            Votes:
            39 Vote for this issue
            Watchers:
            37 Start watching this issue

              Created:
              Updated: