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

Agile view in project sidebar - Project Versions not being cached

      Summary

      Project view page loading is very slow with million issues, 2,500 projects and 1,500 boards. In this specific bug report, this is due to the Project Versions not being cached. Instances with large number of Versions are affected, example:

      Versions: 12416
      Versions: 19755
      Versions: 16263
      

      Environment

      • JIRA 6.4.5
      • JIRA Agile 6.7.6
      • MySQL 5.6.x

      Expected Results

      Faster project view page loading less than 130 seconds (at least a half of the current result).

      Actual Results

      Actual project view page loading is around 130 seconds.

      Verification

      Taking thread dumps as per Generate a Thread Dump during problematic periods of slowness, and searching for the below stack traces can indicate this is a problem:

      "catalina-ssl-exec-1" daemon prio=10 tid=0x00002b9068fe1000 nid=0x1ae1 runnable [0x00002b906f190000]
         java.lang.Thread.State: RUNNABLE
      	at java.util.HashMap.putAllForCreate(HashMap.java:558)
      	at java.util.HashMap.<init>(HashMap.java:298)
      	at org.ofbiz.core.entity.GenericValue.copyOriginalDbValues(GenericValue.java:129)
      	at org.ofbiz.core.entity.EntityListIterator.currentGenericValue(EntityListIterator.java:173)
      	at org.ofbiz.core.entity.EntityListIterator.next(EntityListIterator.java:246)
      	at org.ofbiz.core.entity.EntityListIterator.getCompleteList(EntityListIterator.java:308)
      	at org.ofbiz.core.entity.GenericDAO.selectByAnd(GenericDAO.java:740)
      	at org.ofbiz.core.entity.GenericHelperDAO.findByAnd(GenericHelperDAO.java:150)
      	at org.ofbiz.core.entity.GenericDelegator.findByAnd(GenericDelegator.java:901)
      	at org.ofbiz.core.entity.GenericDelegator.findByAnd(GenericDelegator.java:879)
      	at org.ofbiz.core.entity.GenericDelegator.findAll(GenericDelegator.java:802)
      	at com.atlassian.jira.ofbiz.DefaultOfBizDelegator.findAll(DefaultOfBizDelegator.java:361)
      	at com.atlassian.jira.ofbiz.WrappingOfBizDelegator.findAll(WrappingOfBizDelegator.java:206)
      	at com.atlassian.jira.project.version.OfBizVersionStore.getAllVersions(OfBizVersionStore.java:44)
      	at com.atlassian.jira.project.version.OfBizVersionStore.getVersionsByName(OfBizVersionStore.java:64)
      	at com.atlassian.jira.project.version.CachingVersionStore$3.load(CachingVersionStore.java:71)
      	at com.atlassian.jira.project.version.CachingVersionStore$3.load(CachingVersionStore.java:66)
      	at com.atlassian.cache.memory.MemoryCacheManager$3$1.load(MemoryCacheManager.java:137)
      	at com.atlassian.cache.memory.BlockingCacheLoader.load(BlockingCacheLoader.java:51)
      	at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3573)
      	at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2350)
      	at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2313)
      	- locked <0x000000047c77c6b8> (a com.google.common.cache.LocalCache$StrongEntry)
      	at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2228)
      	at com.google.common.cache.LocalCache.get(LocalCache.java:3970)
      	at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3974)
      	at com.google.common.cache.LocalCache$LocalManualCache.get(LocalCache.java:4834)
      	at com.atlassian.cache.memory.DelegatingCache$DelegatingLoadingCache.get(DelegatingCache.java:316)
      	at com.atlassian.jira.project.version.CachingVersionStore.getVersionsByName(CachingVersionStore.java:148)
      	at com.atlassian.jira.project.version.DefaultVersionManager.getVersionsByName(DefaultVersionManager.java:577)
      	at com.atlassian.jira.jql.resolver.VersionResolver.getIdsFromName(VersionResolver.java:30)
      	at com.atlassian.jira.jql.resolver.VersionIndexInfoResolver.getIndexedValues(VersionIndexInfoResolver.java:29)
      	at com.atlassian.jira.jql.query.AbstractOperatorQueryFactory.getIndexValues(AbstractOperatorQueryFactory.java:66)
      	at com.atlassian.jira.jql.query.AbstractEqualityQueryFactory.createQueryForSingleValue(AbstractEqualityQueryFactory.java:34)
      	at com.atlassian.jira.jql.query.GenericClauseQueryFactory.getQuery(GenericClauseQueryFactory.java:72)
      	at com.atlassian.jira.jql.query.FixForVersionClauseQueryFactory.getQuery(FixForVersionClauseQueryFactory.java:41)
      	at com.atlassian.jira.plugins.issue.create.context.jql.LuceneHelpers$$anonfun$getValueFromLuceneSearcher$1.apply(LuceneHelpers.scala:35)
      	at com.atlassian.jira.plugins.issue.create.context.jql.LuceneHelpers$$anonfun$getValueFromLuceneSearcher$1.apply(LuceneHelpers.scala:34)
      	at scala.Option.flatMap(Option.scala:170)
      	at com.atlassian.jira.plugins.issue.create.context.jql.LuceneHelpers$class.getValueFromLuceneSearcher(LuceneHelpers.scala:34)
      	at com.atlassian.jira.plugins.issue.create.context.fields.FixVersionJQLInputMapper.getValueFromLuceneSearcher(FixVersionJQLInputMapper.scala:10)
      	at com.atlassian.jira.plugins.issue.create.context.jql.LuceneHelpers$class.getValueFromLuceneSearcher(LuceneHelpers.scala:28)
      	at com.atlassian.jira.plugins.issue.create.context.fields.FixVersionJQLInputMapper.getValueFromLuceneSearcher(FixVersionJQLInputMapper.scala:10)
      	at com.atlassian.jira.plugins.issue.create.context.fields.helpers.GenericClauseInputMapper$$anonfun$apply$1.apply(GenericClauseInputMapper.scala:13)
      	at com.atlassian.jira.plugins.issue.create.context.fields.helpers.GenericClauseInputMapper$$anonfun$apply$1.apply(GenericClauseInputMapper.scala:12)
      	at scala.Option.flatMap(Option.scala:170)
      	at com.atlassian.jira.plugins.issue.create.context.fields.helpers.GenericClauseInputMapper$class.apply(GenericClauseInputMapper.scala:12)
      	at com.atlassian.jira.plugins.issue.create.context.fields.FixVersionJQLInputMapper.apply(FixVersionJQLInputMapper.scala:10)
      	at com.atlassian.jira.plugins.issue.create.context.InputParamsBuilder$$anonfun$mapEntry$1.applyOrElse(InputParamsBuilder.scala:106)
      	at com.atlassian.jira.plugins.issue.create.context.InputParamsBuilder$$anonfun$mapEntry$1.applyOrElse(InputParamsBuilder.scala:105)
      	at scala.runtime.AbstractPartialFunction.apply(AbstractPartialFunction.scala:33)
      	at scala.Option.collect(Option.scala:250)
      	....
      

      The stack trace may differ given the version and also database used - the specific class to look for is com.atlassian.greenhopper.web.sidebar.AgileBoardScopeFilterContextProvider.getContext(AgileBoardScopeFilterContextProvider.java:27).

      Notes

      There is a possible bottleneck when user tries to open the project view page. And it is related to Project Versions. Basically when JIRA fetches project versions it makes subsequent calls to DB for each version and selects all values from the table (no cache), after that it iterates through selected version values and filters them. It could be a problem when JIRA has more than a million issues, 2,500 projects and 1,500 boards.

      Workaround

      Use the following steps below.

      1. Disable the board-scope-filter module in JIRA Agile Add-on (board-scope-filter module tells the sidebar the list of boards to show on the board dropdown as well as the board that is currently selected.).
        1. Navigate through Administration menu > Add-ons > Manage Add-ons > Select 'JIRA Agile'
        2. Expand the JIRA Agile Add-on modules
        3. Find the 'board-scope-filter' module and disable it.
      2. Disable Project Navigation (Sidebar project navigation) for all users: Administration Menu > System > Project Navigation

            [JRASERVER-45178] Agile view in project sidebar - Project Versions not being cached

            Just got back to Jira 8.9 from a far earlier release. This is hilariously difficult to do - why have the Sprint and Backlog items been hidden/removed? The old Jira worked perfectly out of the box. Now, I am trudging through menu after menu not finding any of the ways to turn this back on. Should I downgrade back to what I'm used to (or is there a reasonable Jira alternative)? Very frustrated at this point...

            David M Patterson added a comment - Just got back to Jira 8.9 from a far earlier release. This is hilariously difficult to do - why have the Sprint and Backlog items been hidden/removed? The old Jira worked perfectly out of the box. Now, I am trudging through menu after menu not finding any of the ways to turn this back on. Should I downgrade back to what I'm used to (or is there a reasonable Jira alternative)? Very frustrated at this point...

            What is the workaround for JIRA 7.x?

            Chad Barnes added a comment - What is the workaround for JIRA 7.x?

            The workaround in this issue fixed our performance issues accessing project summary pages. We were recording steady, 30-minute intervals where project page access (any and all projects) would take nearly 2m (issue, filter, and dashboard access was unaffected). It was predictable at 30-minute intervals.

            We had already disabled the navigation bar. Disabling the described module eliminated the delays when accessing the project pages.

            Which version is this fix targeted for? Is there any way to increase this particular cache (assuming only the number of versions cause this behavior)?

            Chad Barnes added a comment - The workaround in this issue fixed our performance issues accessing project summary pages. We were recording steady, 30-minute intervals where project page access (any and all projects) would take nearly 2m (issue, filter, and dashboard access was unaffected). It was predictable at 30-minute intervals. We had already disabled the navigation bar. Disabling the described module eliminated the delays when accessing the project pages. Which version is this fix targeted for? Is there any way to increase this particular cache (assuming only the number of versions cause this behavior)?

            l added a comment -

            When this bug will get fixed?

            l added a comment - When this bug will get fixed?

            Confirmed it's a different bottleneck in the SQL query performed by OfBizVersionStore.getVersionsByName which is inefficient.

            This issue should not be common because it requires a very large amount of versions and frequent updates to the database such that the versionsByName cache is invalidated so frequently that we end up doing the expensive database call often.

            Oswaldo Hernandez (Inactive) added a comment - Confirmed it's a different bottleneck in the SQL query performed by OfBizVersionStore.getVersionsByName which is inefficient. This issue should not be common because it requires a very large amount of versions and frequent updates to the database such that the versionsByName cache is invalidated so frequently that we end up doing the expensive database call often.

              lsilva Luiz Silva
              smeshkov Sergey Meshkov (Inactive)
              Affected customers:
              11 This affects my team
              Watchers:
              28 Start watching this issue

                Created:
                Updated:
                Resolved: