Uploaded image for project: 'Jira Software Data Center'
  1. Jira Software Data Center
  2. JSWSERVER-10790

Improvement: Introduce JVM lock when ranking initially to prevent high contention during full reIndex

    XMLWordPrintable

Details

    • 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

      When a system has a lot of missing rank values for issues or none at all, a foreground reIndex will trigger rankInitially for a lot of issues. This type of rank operation will rank the issue to the bottom of the ordering, which requires the bottom 2 rows to be locked before a value can be assigned. Foreground reIndex uses up to 10 threads so this will cause a lot of contention to acquire locks on those 2 bottom rows.

      The entries below are visible in the logs:

      (...)
      2014-06-06 10:52:09,857 IssueIndexer:thread-7 WARN jirauser 778x220x1 10qtvrt 0:0:0:0:0:0:0:1 /secure/admin/jira/IndexReIndex.jspa [greenhopper.customfield.lexorank.LexoRankCFType] Unable to retrieve rank for field [10801] and issue [69426]
      2014-06-06 10:52:09,857 IssueIndexer:thread-7 WARN jirauser 778x220x1 10qtvrt 0:0:0:0:0:0:0:1 /secure/admin/jira/IndexReIndex.jspa [greenhopper.customfield.lexorank.LexoRankCFType] gh.lexorank.service.error.retrytimeout
      2014-06-06 10:52:09,857 IssueIndexer:thread-7 WARN jirauser 778x220x1 10qtvrt 0:0:0:0:0:0:0:1 /secure/admin/jira/IndexReIndex.jspa [greenhopper.customfield.lexorank.LexoRankIndexer] Could not retrieve LexoRank value for issue[id=69426]. Indexing max LexoRank value instead.
      2014-06-06 10:52:10,748 IssueIndexer:thread-3 WARN jirauser 778x220x1 10qtvrt 0:0:0:0:0:0:0:1 /secure/admin/jira/IndexReIndex.jspa [greenhopper.customfield.lexorank.LexoRankCFType] Unable to retrieve rank for field [10801] and issue [69420]
      2014-06-06 10:52:10,748 IssueIndexer:thread-3 WARN jirauser 778x220x1 10qtvrt 0:0:0:0:0:0:0:1 /secure/admin/jira/IndexReIndex.jspa [greenhopper.customfield.lexorank.LexoRankCFType] gh.lexorank.service.error.retrytimeout
      2014-06-06 10:52:10,748 IssueIndexer:thread-3 WARN jirauser 778x220x1 10qtvrt 0:0:0:0:0:0:0:1 /secure/admin/jira/IndexReIndex.jspa [greenhopper.customfield.lexorank.LexoRankIndexer] Could not retrieve LexoRank value for issue[id=69420]. Indexing max LexoRank value instead.
      (...)
      

      This can impact the instance by causing excessive reindexing times. For example an instance with the following stats has taken 6 hours to index and is only at 26%:

      ___ Database Statistics ____________________
      
           Issues                                        : 397982
           Projects                                      : 218
           Custom Fields                                 : 165
           Workflows                                     : 120
           Users                                         : 18587
           Groups                                        : 2805
           Attachments                                   : 163215
           Comments                                      : 1567415
      
      

      We should introduce a JVM lock on the rankInitially part of the rank operation reduce this expected contention.

      Workaround

      1. Stop JIRA to cancel the index.
      2. Backup the database.
      3. Start JIRA.
      4. Unlock the rank fields as per How to unlock a Locked field.
      5. Rename the rank fields to something else, for example Rank (LexoRank).
      6. Rename the old (Obsolete) fields to their original name.
      7. Uninstall JIRA Agile.
      8. Stop JIRA.
      9. Roll-back the JIRA Agile version in the database with the following SQL:
        UPDATE propertynumber SET propertyvalue = 42 WHERE id = (SELECT id FROM propertyentry WHERE property_key = 'GreenHopper.Upgrade.Latest.Upgraded.Version');
        UPDATE propertystring SET propertyvalue = '42' WHERE id = (SELECT id FROM propertyentry WHERE property_key = 'com.pyxis.greenhopper.jira:build');
        
      10. Start JIRA.
      11. Install the previous version of JIRA Agile 6.3.13.1.
      12. Reindex JIRA.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              melias MichaelA (Inactive)
              Votes:
              4 Vote for this issue
              Watchers:
              24 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: