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

Update pocket-knife to 4.x in Project Templates plugin

    XMLWordPrintable

Details

    Description

      Summary

      The releases of pocket-knife up to 3.x included two methods - findTableNames and findColumnNames - which used a metadata query known to cause performance problems in Oracle: metaData.getTables(null, null, null, null) and metaData.getColumns(null, null, null, null).

      This code has been removed on 4.x releases.

      Expected Behavior

      Only retrieve metadata for objects relevant to the operation, which can be achieved by optimizing the call of this method - passing a new parameter to it that filters results.

      Example: metaData.getTables(null, null, null, new String[]{"TABLE"})

      In newer releases of pocket-knife, these two methods do not exist anymore. Since it was updated in Feb 2016, JIRA should use this new release.

      Actual Behavior

      This code ends up retrieving lots of objects from the public schema in Oracle that are not relevant. In one case, it returned 60,000 objects, causing a severe performance bottleneck in JIRA instances connected to this DBMS.

      This library is used by the Project Templates plugin, bundled in JIRA, and makes the creation of a new project very slow at the first time it's triggered after a restart. The below can be seen when analyzing hot spots in database queries. Notice the query called by pocket-knife runs for ~37s.

      !

      Steps to Reproduce

      1. Connect JIRA 7.1.x to an Oracle 12c database;
      2. Right after JIRA's startup, try creating a new project;
      3. Notice subsequent creation of projects will be considerably faster;

      Workaround

      There are no known workarounds for this problem yet. However, the slowness is only noticed at the first time any issue update happens, until a restart of JIRA.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              jpalharini Joao Palharini (Inactive)
              Votes:
              3 Vote for this issue
              Watchers:
              12 Start watching this issue

              Dates

                Created:
                Updated: