Package org.elasticsearch.index.seqno
Class RetentionLeaseBackgroundSyncAction
java.lang.Object
org.elasticsearch.action.support.TransportAction<Request,Response>
org.elasticsearch.action.support.replication.TransportReplicationAction<RetentionLeaseBackgroundSyncAction.Request,RetentionLeaseBackgroundSyncAction.Request,ReplicationResponse>
org.elasticsearch.index.seqno.RetentionLeaseBackgroundSyncAction
public class RetentionLeaseBackgroundSyncAction
extends TransportReplicationAction<RetentionLeaseBackgroundSyncAction.Request,RetentionLeaseBackgroundSyncAction.Request,ReplicationResponse>
Replication action responsible for background syncing retention leases to replicas. This action is deliberately a replication action so
that if a replica misses a background retention lease sync then that shard will not be marked as stale. We have some tolerance for a
shard copy missing renewals of retention leases since the background sync interval is much smaller than the expected lifetime of
retention leases.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.elasticsearch.action.support.replication.TransportReplicationAction
TransportReplicationAction.ConcreteReplicaRequest<R extends TransportRequest>, TransportReplicationAction.ConcreteShardRequest<R extends TransportRequest>, TransportReplicationAction.PrimaryResult<ReplicaRequest extends ReplicationRequest<ReplicaRequest>,Response extends ReplicationResponse>, TransportReplicationAction.ReplicaResponse, TransportReplicationAction.ReplicaResult, TransportReplicationAction.ReplicasProxy, TransportReplicationAction.RetryOnReplicaException
-
Field Summary
Fields inherited from class org.elasticsearch.action.support.replication.TransportReplicationAction
clusterService, executor, forceExecutionOnPrimary, indicesService, REPLICATION_INITIAL_RETRY_BACKOFF_BOUND, REPLICATION_RETRY_TIMEOUT, shardStateAction, threadPool, transportOptions, transportPrimaryAction, transportReplicaAction, transportService
Fields inherited from class org.elasticsearch.action.support.TransportAction
actionName, localConnection, logger, taskManager
-
Constructor Summary
ConstructorDescriptionRetentionLeaseBackgroundSyncAction(Settings settings, TransportService transportService, ClusterService clusterService, IndicesService indicesService, ThreadPool threadPool, ShardStateAction shardStateAction, ActionFilters actionFilters)
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
doExecute(Task task, RetentionLeaseBackgroundSyncAction.Request request, ActionListener<ReplicationResponse> listener)
protected org.apache.logging.log4j.Logger
protected ReplicationResponse
protected void
shardOperationOnPrimary(RetentionLeaseBackgroundSyncAction.Request request, IndexShard primary, ActionListener<TransportReplicationAction.PrimaryResult<RetentionLeaseBackgroundSyncAction.Request,ReplicationResponse>> listener)
Primary operation on node with primary copy.protected void
shardOperationOnReplica(RetentionLeaseBackgroundSyncAction.Request request, IndexShard replica, ActionListener<TransportReplicationAction.ReplicaResult> listener)
Execute the specified replica operation.Methods inherited from class org.elasticsearch.action.support.replication.TransportReplicationAction
acquirePrimaryOperationPermit, acquireReplicaOperationPermit, adaptResponse, checkOperationLimits, checkPrimaryLimits, checkReplicaLimits, globalBlockLevel, handlePrimaryRequest, handleReplicaRequest, indexBlockLevel, newReplicasProxy, resolveRequest, retryPrimaryException, transportOptions
Methods inherited from class org.elasticsearch.action.support.TransportAction
execute, execute, execute
-
Field Details
-
ACTION_NAME
- See Also:
- Constant Field Values
-
-
Constructor Details
-
RetentionLeaseBackgroundSyncAction
@Inject public RetentionLeaseBackgroundSyncAction(Settings settings, TransportService transportService, ClusterService clusterService, IndicesService indicesService, ThreadPool threadPool, ShardStateAction shardStateAction, ActionFilters actionFilters)
-
-
Method Details
-
getLogger
protected org.apache.logging.log4j.Logger getLogger() -
doExecute
protected void doExecute(Task task, RetentionLeaseBackgroundSyncAction.Request request, ActionListener<ReplicationResponse> listener) -
shardOperationOnPrimary
protected void shardOperationOnPrimary(RetentionLeaseBackgroundSyncAction.Request request, IndexShard primary, ActionListener<TransportReplicationAction.PrimaryResult<RetentionLeaseBackgroundSyncAction.Request,ReplicationResponse>> listener)Description copied from class:TransportReplicationAction
Primary operation on node with primary copy.- Specified by:
shardOperationOnPrimary
in classTransportReplicationAction<RetentionLeaseBackgroundSyncAction.Request,RetentionLeaseBackgroundSyncAction.Request,ReplicationResponse>
- Parameters:
request
- the request to the primary shardprimary
- the primary shard to perform the operation on
-
shardOperationOnReplica
protected void shardOperationOnReplica(RetentionLeaseBackgroundSyncAction.Request request, IndexShard replica, ActionListener<TransportReplicationAction.ReplicaResult> listener)Description copied from class:TransportReplicationAction
Execute the specified replica operation. This is done under a permit fromIndexShard.acquireReplicaOperationPermit(long, long, long, ActionListener, String, Object)
.- Specified by:
shardOperationOnReplica
in classTransportReplicationAction<RetentionLeaseBackgroundSyncAction.Request,RetentionLeaseBackgroundSyncAction.Request,ReplicationResponse>
- Parameters:
request
- the request to the replica shardreplica
- the replica shard to perform the operation on
-
newResponseInstance
-