-
Bug
-
Resolution: Fixed
-
Low
-
8.20.0, 9.3.0
-
8.2
-
Severity 3 - Minor
-
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
- Make a change to cause issue indexing.
- 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.