Package com.atlassian.jira.index.ha
Class DefaultServerIndexRepairService
java.lang.Object
com.atlassian.jira.index.ha.DefaultServerIndexRepairService
- All Implemented Interfaces:
SingleNodeIndexRepairService
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longstatic final longstatic final longSeeSYSTEM_PROPERTY_SAFETY_MARGIN_SECONDSfor an explanation of these two constituents of the safety margin.static final Stringstatic final Stringstatic final StringThe repair job replays all de-index operations since thelastRun. -
Constructor Summary
ConstructorsConstructorDescriptionDefaultServerIndexRepairService(JiraProperties jiraProperties, com.atlassian.event.api.EventPublisher eventPublisher, IndexRecoveryManager indexRecoveryManager) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidvoidvoidonPluginFrameworkShutdown(com.atlassian.plugin.event.events.PluginFrameworkShutdownEvent event) voidonPluginFrameworkStarted(com.atlassian.plugin.event.events.PluginFrameworkStartedEvent event) voidpause()voidshutdown()voidstart()
-
Field Details
-
SYSTEM_PROPERTY_PERIOD_SECONDS
- See Also:
-
DEFAULT_PERIOD_SECONDS
public static final long DEFAULT_PERIOD_SECONDS- See Also:
-
SYSTEM_PROPERTY_MAX_TIMESPAN_SECONDS
- See Also:
-
DEFAULT_MAX_TIMESPAN_SECONDS
public static final long DEFAULT_MAX_TIMESPAN_SECONDS -
SYSTEM_PROPERTY_SAFETY_MARGIN_SECONDS
The repair job replays all de-index operations since thelastRun. However, we need to take into account possible delays. A (relatively small) delay can happen between when we calculate therangeindeindexRecentOperations()and when we actually executeIndexRecoveryManager.deindexEntitiesDeletedInTheLast(Duration, TaskProgressSink). The safety margin needs to be long enough for the next repair job to "reach" the deletion operation of the slowly indexed issue. Therefore, the second constituent of the safety margin needs to be as long as we allow the issue document building to be. The corresponding mechanism in DC is based on DefaultNodeReindexService replaying local node operations after a fixed delay. The delay is configured in DefaultNodeReindexService#delayInSeconds and is tied toLocalQConfig.putTTLMillis().- See Also:
-
DEFAULT_SAFETY_MARGIN_SECONDS
public static final long DEFAULT_SAFETY_MARGIN_SECONDSSeeSYSTEM_PROPERTY_SAFETY_MARGIN_SECONDSfor an explanation of these two constituents of the safety margin.- See Also:
-
-
Constructor Details
-
DefaultServerIndexRepairService
public DefaultServerIndexRepairService(JiraProperties jiraProperties, com.atlassian.event.api.EventPublisher eventPublisher, IndexRecoveryManager indexRecoveryManager)
-
-
Method Details
-
onPluginFrameworkStarted
@EventListener public void onPluginFrameworkStarted(com.atlassian.plugin.event.events.PluginFrameworkStartedEvent event) - Specified by:
onPluginFrameworkStartedin interfaceSingleNodeIndexRepairService
-
onIndexingShutdownEvent
- Specified by:
onIndexingShutdownEventin interfaceSingleNodeIndexRepairService
-
onImportStartedEvent
- Specified by:
onImportStartedEventin interfaceSingleNodeIndexRepairService
-
onImportCompletedEvent
- Specified by:
onImportCompletedEventin interfaceSingleNodeIndexRepairService
-
pause
public void pause()- Specified by:
pausein interfaceSingleNodeIndexRepairService
-
start
public void start()- Specified by:
startin interfaceSingleNodeIndexRepairService
-
onPluginFrameworkShutdown
@EventListener public void onPluginFrameworkShutdown(com.atlassian.plugin.event.events.PluginFrameworkShutdownEvent event) - Specified by:
onPluginFrameworkShutdownin interfaceSingleNodeIndexRepairService
-
shutdown
public void shutdown()- Specified by:
shutdownin interfaceSingleNodeIndexRepairService
-