Package com.atlassian.jira.index.ha
Interface IndexRecoveryManager
- All Superinterfaces:
Sized
- All Known Implementing Classes:
DefaultIndexRecoveryManager
Manager to recover an index from a previous index backup
- Since:
- v6.2
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondeindexEntitiesDeletedInTheLast(Duration duration, TaskProgressSink taskProgressSink) Applies de-index based on the versioning table (delete column.* Why this method may be needed? It is possible in Jira (both server and DC) that a late "update" will override a "delete".com.atlassian.core.util.DateUtils.DateRangeGets the updated date range for issues that need to be re-indexed because the latest updates are missing from the index.recoverIndexFromBackup(File recoveryFile, TaskProgressSink taskProgressSink) Recovers an index from an index backup.reindexWithVersionCheckEntitiesUpdatedInTheLast(Duration duration, TaskProgressSink taskProgressSink) This method uses versioning to short-circuit building documents when the index version is already up-to-date with what's in the db.safeRecoverIndexFromBackup(File recoveryFile, TaskProgressSink taskProgressSink) Recovers an index from an index backup.
-
Field Details
-
SNAPSHOT_ARCHIVE
- See Also:
-
INDEXSNAPSHOTS
- See Also:
-
-
Method Details
-
safeRecoverIndexFromBackup
IndexCommandResult safeRecoverIndexFromBackup(File recoveryFile, TaskProgressSink taskProgressSink) throws IndexException Recovers an index from an index backup. This method throws and stops processing if it's not able to calculate the duration where catch up needs to be applied.- Parameters:
recoveryFile- The backup filetaskProgressSink- The sink to report progress back.- Throws:
IndexException- If we are unable to recover the index or catch up after recovery is successful
-
recoverIndexFromBackup
IndexCommandResult recoverIndexFromBackup(File recoveryFile, TaskProgressSink taskProgressSink) throws IndexException Recovers an index from an index backup. Unlike thesafeRecoverIndexFromBackup(java.io.File, com.atlassian.jira.task.TaskProgressSink)this method won't throw exception when not being able to to calculate the duration where catch up needs to be applied. It will skip the catch up and continue with other steps.- Parameters:
recoveryFile- The backup filetaskProgressSink-- Throws:
IndexException- If we are unable to recover the index or catch up after recovery is successful
-
getDurationToCatchUpUsingVersions
com.atlassian.core.util.DateUtils.DateRange getDurationToCatchUpUsingVersions()Gets the updated date range for issues that need to be re-indexed because the latest updates are missing from the index. The range is- from
- Latest date in the index
- to
- Latest date in the database
Note: the latest db date is based on the issue_version table. If no versions are present, we fall back to the issues table (although deletes will not be reflected here).- Returns:
- Date range of issues that need to be re-indexed.
- Since:
- v6.4
-
reindexWithVersionCheckEntitiesUpdatedInTheLast
IndexRecoveryResult reindexWithVersionCheckEntitiesUpdatedInTheLast(Duration duration, TaskProgressSink taskProgressSink) throws IndexException, SearchException This method uses versioning to short-circuit building documents when the index version is already up-to-date with what's in the db. Ensures that issues which have been modified between now anddurationago are up-to-date in the index. They are reindexed/deindexed as needed to achieve this.- Parameters:
duration- specifies how far back (from present time) to look for updated issuestaskProgressSink- A progress sink.- Returns:
- Report how much time the operation took and how many issues were affected
- Throws:
IndexExceptionSearchException- Since:
- 8.10
-
deindexEntitiesDeletedInTheLast
IndexRecoveryResult deindexEntitiesDeletedInTheLast(Duration duration, TaskProgressSink taskProgressSink) throws IndexException Applies de-index based on the versioning table (delete column.* Why this method may be needed? It is possible in Jira (both server and DC) that a late "update" will override a "delete". To handle this problem, Jira has to replay de-index operations after "some time". See:EntityVersioningManager) See:VersioningDaoSee:NodeReindexServiceSee:DefaultServerIndexRepairService- Parameters:
duration- specifies how far back (from present time) to look for deleted issuestaskProgressSink- A progress sink.- Returns:
- result of de-indexing
- Throws:
IndexException- Since:
- 8.14
-