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

During Jira startup the index fixer unhelpfully adds a range of 24 hours to catch-up modifications

XMLWordPrintable

      Issue Summary

      During the startup phase Jira will check for local index consistency – check Changes to index management on the Jira startup in version 9.1 for more details.

      There may be times the index needs to be recovered from a snapshot.
      As part of the index snapshot recover process, index fixer will unhelpfully include 24 hours to the range no matter how close/far the recovered index is from the database.

      This also happens on a regular startup even when the local index is healthy.

      This adds overhead to the startup process and may not be necessary on every condition.

      Steps to Reproduce

      When the index snapshot is recovered:

      1. Install a vanilla instance of Jira Software Data Center.
      2. Create a couple of projects to have something to reindex.
      3. Run a full reindex, which will create an index snapshot.
      4. Create a new sample project, which won't eexist on the index snapshot.
      5. Stop Jira.
      6. Remove the local index by deleting all directories within <jira-local-home>/caches/indexesV2/.
      7. Start Jira to trigger the index restore from the snapshot.


      When local index is healthy:

      1. Install a vanilla instance of Jira Software Data Center with 2 nodes – say it node1 and node2.
      2. Create a couple of projects to have something to reindex.
      3. Stop Jira on node2 and let it running on node1.
      4. Create only one Jira issue while the application is running on node1.
      5. Start Jira on node2.

      Expected Results

      The index fixer compares the data from the database and the snapshot, identifying that the index is a few minutes behind.
      Then the index fixer goes back only the few necessary minutes.

      Actual Results

      The index fixer compares the data from the database and the snapshot, identifying that the index is a few minutes behind.
      Then the index fixer adds 24 hours to the above range, triggering the reindex of unnecessary items.

      2024-07-23 17:18:54,664+0000 main INFO      [c.a.j.index.ha.DefaultIndexRecoveryManager] [INDEX-FIXER] Re-index start time: {2024-07-23 17:14:31.491}, Latest DB issue-version date: {2024-07-23 17:14:11.231}
      2024-07-23 17:18:54,665+0000 main INFO      [c.a.j.index.ha.DefaultIndexRecoveryManager] [INDEX-FIXER] Re-indexing issues updated in the last {1 days, 0 hours, 4 minutes, and 23 seconds}. (Note: it's an intentionally wider range)
      

      On a production instance this may be more problematic as a lot of changes could occur within 24 hours, causing unnecessary overhead to the index recovery process.

      This started to be more concerning on Jira 9.1+ as the local index healthy check is a synchronous process on which each node acquires a cluster lock, delaying other nodes from startup.

      The problem may be exacerbated by JRASERVER-76237.

      Workaround

      Currently there is no known workaround for this behavior. A workaround will be added here when available.

              Unassigned Unassigned
              tmasutti Thiago Masutti
              Votes:
              3 Vote for this issue
              Watchers:
              14 Start watching this issue

                Created:
                Updated: