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 long
static final long
static final long
SeeSYSTEM_PROPERTY_SAFETY_MARGIN_SECONDS
for an explanation of these two constituents of the safety margin.static final String
static final String
static final String
The 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 TypeMethodDescriptionvoid
void
void
void
onPluginFrameworkShutdown
(com.atlassian.plugin.event.events.PluginFrameworkShutdownEvent event) void
onPluginFrameworkStarted
(com.atlassian.plugin.event.events.PluginFrameworkStartedEvent event) void
pause()
void
shutdown()
void
start()
-
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 therange
indeindexRecentOperations()
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_SECONDS
for 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:
onPluginFrameworkStarted
in interfaceSingleNodeIndexRepairService
-
onIndexingShutdownEvent
- Specified by:
onIndexingShutdownEvent
in interfaceSingleNodeIndexRepairService
-
onImportStartedEvent
- Specified by:
onImportStartedEvent
in interfaceSingleNodeIndexRepairService
-
onImportCompletedEvent
- Specified by:
onImportCompletedEvent
in interfaceSingleNodeIndexRepairService
-
pause
public void pause()- Specified by:
pause
in interfaceSingleNodeIndexRepairService
-
start
public void start()- Specified by:
start
in interfaceSingleNodeIndexRepairService
-
onPluginFrameworkShutdown
@EventListener public void onPluginFrameworkShutdown(com.atlassian.plugin.event.events.PluginFrameworkShutdownEvent event) - Specified by:
onPluginFrameworkShutdown
in interfaceSingleNodeIndexRepairService
-
shutdown
public void shutdown()- Specified by:
shutdown
in interfaceSingleNodeIndexRepairService
-