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

Index snapshot (periodic and after background reindex) misses up to 30s of indexed issues

    XMLWordPrintable

Details

    Description

      Issue Summary

      Index snapshot can miss up to 30s worth of indexing when periodic snapshot is used, or when snapshot is created after full background reindex.

      When full foreground reindex is used, this problem does not exist.

      Technical details

      When index snapshot is created, we freeze its current state as it is on the disk with  org.apache.lucene.index.SnapshotDeletionPolicy#snapshot. To create an archive we copy files directly from the disk. However, Lucene writes to disk with up to 30s delay. This means whatever has been indexed in the last 30s might not have made it to the index snapshot.

      We should call org.apache.lucene.index.IndexWriter#commit just before calling snapshot to ensure everything is written to the disk.

      This affects all types of indexing apart from full foreground reindex.

      This is reproducible on Data Center: yes

      Steps to Reproduce

      1. Make a change to cause issue indexing.
      2. Immediately create index snapshot.

      It's difficult to create a snapshot immediately. It either requires syncing with the periodic snapshot scheduler, or running background reindex. This bug is easiest to reproduce when there are only a few issues in Jira.

      Expected Results

      Index snapshot contains everything that has been indexed so far.

      Actual Results

      Index snapshot misses the most recently indexed issues.

      Workaround

      Schedule index snapshots for a quiet period that no issues are updated.

      Attachments

        Issue Links

          Activity

            People

              kcichy Kamil Cichy
              kcichy Kamil Cichy
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: