Package org.elasticsearch.index.seqno
Class GlobalCheckpointSyncAction
- java.lang.Object
-
- org.elasticsearch.common.component.AbstractComponent
-
- org.elasticsearch.action.support.TransportAction<Request,Response>
-
- org.elasticsearch.action.support.replication.TransportReplicationAction<GlobalCheckpointSyncAction.Request,GlobalCheckpointSyncAction.Request,ReplicationResponse>
-
- org.elasticsearch.index.seqno.GlobalCheckpointSyncAction
-
public class GlobalCheckpointSyncAction extends TransportReplicationAction<GlobalCheckpointSyncAction.Request,GlobalCheckpointSyncAction.Request,ReplicationResponse>
Background global checkpoint sync action initiated when a shard goes inactive. This is needed because while we send the global checkpoint on every replication operation, after the last operation completes the global checkpoint could advance but without a follow-up operation the global checkpoint will never be synced to the replicas.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
GlobalCheckpointSyncAction.Request
-
Nested classes/interfaces inherited from class org.elasticsearch.action.support.replication.TransportReplicationAction
TransportReplicationAction.ConcreteReplicaRequest<R extends TransportRequest>, TransportReplicationAction.ConcreteShardRequest<R extends TransportRequest>, TransportReplicationAction.OperationTransportHandler, TransportReplicationAction.PrimaryOperationTransportHandler, TransportReplicationAction.PrimaryResult<ReplicaRequest extends ReplicationRequest<ReplicaRequest>,Response extends ReplicationResponse>, TransportReplicationAction.ReplicaOperationTransportHandler, 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, indexNameExpressionResolver, indicesService, shardStateAction, threadPool, transportOptions, transportPrimaryAction, transportReplicaAction, transportService
-
Fields inherited from class org.elasticsearch.action.support.TransportAction
actionName, taskManager
-
Fields inherited from class org.elasticsearch.common.component.AbstractComponent
logger
-
-
Constructor Summary
Constructors Constructor Description GlobalCheckpointSyncAction(Settings settings, TransportService transportService, ClusterService clusterService, IndicesService indicesService, ThreadPool threadPool, ShardStateAction shardStateAction, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ReplicationResponse
newResponseInstance()
protected void
sendReplicaRequest(TransportReplicationAction.ConcreteReplicaRequest<GlobalCheckpointSyncAction.Request> replicaRequest, DiscoveryNode node, ActionListener<ReplicationOperation.ReplicaResponse> listener)
Sends the specified replica request to the specified node.protected TransportReplicationAction.PrimaryResult<GlobalCheckpointSyncAction.Request,ReplicationResponse>
shardOperationOnPrimary(GlobalCheckpointSyncAction.Request request, IndexShard indexShard)
Primary operation on node with primary copy.protected TransportReplicationAction.ReplicaResult
shardOperationOnReplica(GlobalCheckpointSyncAction.Request request, IndexShard indexShard)
Synchronously execute the specified replica operation.void
updateGlobalCheckpointForShard(ShardId shardId)
-
Methods inherited from class org.elasticsearch.action.support.replication.TransportReplicationAction
doExecute, getIndexShard, globalBlockLevel, indexBlockLevel, newReplicasProxy, registerRequestHandlers, resolveIndex, resolveRequest, retryPrimaryException, transportOptions
-
Methods inherited from class org.elasticsearch.action.support.TransportAction
execute, execute, execute
-
-
-
-
Constructor Detail
-
GlobalCheckpointSyncAction
@Inject public GlobalCheckpointSyncAction(Settings settings, TransportService transportService, ClusterService clusterService, IndicesService indicesService, ThreadPool threadPool, ShardStateAction shardStateAction, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver)
-
-
Method Detail
-
updateGlobalCheckpointForShard
public void updateGlobalCheckpointForShard(ShardId shardId)
-
newResponseInstance
protected ReplicationResponse newResponseInstance()
-
sendReplicaRequest
protected void sendReplicaRequest(TransportReplicationAction.ConcreteReplicaRequest<GlobalCheckpointSyncAction.Request> replicaRequest, DiscoveryNode node, ActionListener<ReplicationOperation.ReplicaResponse> listener)
Description copied from class:TransportReplicationAction
Sends the specified replica request to the specified node.- Overrides:
sendReplicaRequest
in classTransportReplicationAction<GlobalCheckpointSyncAction.Request,GlobalCheckpointSyncAction.Request,ReplicationResponse>
- Parameters:
replicaRequest
- the replica requestnode
- the node to send the request tolistener
- callback for handling the response or failure
-
shardOperationOnPrimary
protected TransportReplicationAction.PrimaryResult<GlobalCheckpointSyncAction.Request,ReplicationResponse> shardOperationOnPrimary(GlobalCheckpointSyncAction.Request request, IndexShard indexShard) throws java.lang.Exception
Description copied from class:TransportReplicationAction
Primary operation on node with primary copy.- Specified by:
shardOperationOnPrimary
in classTransportReplicationAction<GlobalCheckpointSyncAction.Request,GlobalCheckpointSyncAction.Request,ReplicationResponse>
- Parameters:
request
- the request to the primary shardindexShard
- the primary shard to perform the operation on- Throws:
java.lang.Exception
-
shardOperationOnReplica
protected TransportReplicationAction.ReplicaResult shardOperationOnReplica(GlobalCheckpointSyncAction.Request request, IndexShard indexShard) throws java.lang.Exception
Description 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<GlobalCheckpointSyncAction.Request,GlobalCheckpointSyncAction.Request,ReplicationResponse>
- Parameters:
request
- the request to the replica shardindexShard
- the replica shard to perform the operation on- Throws:
java.lang.Exception
-
-