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 Modifier and Type Class Description static class
RetentionLeaseBackgroundSyncAction.Request
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 Modifier and Type Field Description static java.lang.String
ACTION_NAME
Fields inherited from class org.elasticsearch.action.support.replication.TransportReplicationAction
clusterService, executor, indicesService, shardStateAction, threadPool, transportOptions, transportPrimaryAction, transportReplicaAction, transportService
Fields inherited from class org.elasticsearch.action.support.TransportAction
actionName, logger, taskManager
-
Constructor Summary
Constructors Constructor Description RetentionLeaseBackgroundSyncAction(Settings settings, TransportService transportService, ClusterService clusterService, IndicesService indicesService, ThreadPool threadPool, ShardStateAction shardStateAction, ActionFilters actionFilters)
-
Method Summary
Modifier and Type Method Description protected void
doExecute(Task task, RetentionLeaseBackgroundSyncAction.Request request, ActionListener<ReplicationResponse> listener)
protected org.apache.logging.log4j.Logger
getLogger()
protected ReplicationResponse
newResponseInstance(StreamInput in)
protected void
shardOperationOnPrimary(RetentionLeaseBackgroundSyncAction.Request request, IndexShard primary, ActionListener<TransportReplicationAction.PrimaryResult<RetentionLeaseBackgroundSyncAction.Request,ReplicationResponse>> listener)
Primary operation on node with primary copy.protected TransportReplicationAction.ReplicaResult
shardOperationOnReplica(RetentionLeaseBackgroundSyncAction.Request request, IndexShard replica)
Synchronously execute the specified replica operation.Methods inherited from class org.elasticsearch.action.support.replication.TransportReplicationAction
acquirePrimaryOperationPermit, acquireReplicaOperationPermit, adaptResponse, globalBlockLevel, handleOperationRequest, handlePrimaryRequest, handleReplicaRequest, indexBlockLevel, newReplicasProxy, resolveRequest, retryPrimaryException, transportOptions, wrapResponseActionListener
Methods inherited from class org.elasticsearch.action.support.TransportAction
execute, execute, execute
-
Field Details
-
ACTION_NAME
public static final java.lang.String 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 TransportReplicationAction.ReplicaResult shardOperationOnReplica(RetentionLeaseBackgroundSyncAction.Request request, IndexShard replica) throws WriteStateExceptionDescription copied from class:TransportReplicationAction
Synchronously 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- Throws:
WriteStateException
-
newResponseInstance
- Specified by:
newResponseInstance
in classTransportReplicationAction<RetentionLeaseBackgroundSyncAction.Request,RetentionLeaseBackgroundSyncAction.Request,ReplicationResponse>
- Throws:
java.io.IOException
-