Package org.opensearch.index.seqno
Class GlobalCheckpointSyncAction
java.lang.Object
org.opensearch.action.support.TransportAction<GlobalCheckpointSyncAction.Request,ReplicationResponse>
org.opensearch.action.support.replication.TransportReplicationAction<GlobalCheckpointSyncAction.Request,GlobalCheckpointSyncAction.Request,ReplicationResponse>
org.opensearch.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.
- Opensearch.internal:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
Request for checkpoint sync actionNested classes/interfaces inherited from class org.opensearch.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
FieldsFields inherited from class org.opensearch.action.support.replication.TransportReplicationAction
clusterService, executor, forceExecutionOnPrimary, indicesService, PRIMARY_ACTION_SUFFIX, REPLICA_ACTION_SUFFIX, REPLICATION_INITIAL_RETRY_BACKOFF_BOUND, REPLICATION_RETRY_TIMEOUT, shardStateAction, threadPool, transportOptions, transportPrimaryAction, transportReplicaAction, transportService
Fields inherited from class org.opensearch.action.support.TransportAction
actionName, logger, taskManager
-
Constructor Summary
ConstructorsConstructorDescriptionGlobalCheckpointSyncAction
(Settings settings, TransportService transportService, ClusterService clusterService, IndicesService indicesService, ThreadPool threadPool, ShardStateAction shardStateAction, ActionFilters actionFilters) -
Method Summary
Modifier and TypeMethodDescriptionprotected ReplicationResponse
newResponseInstance
(org.opensearch.core.common.io.stream.StreamInput in) protected void
shardOperationOnPrimary
(GlobalCheckpointSyncAction.Request request, IndexShard indexShard, org.opensearch.core.action.ActionListener<TransportReplicationAction.PrimaryResult<GlobalCheckpointSyncAction.Request, ReplicationResponse>> listener) Primary operation on node with primary copy.protected void
shardOperationOnReplica
(GlobalCheckpointSyncAction.Request shardRequest, IndexShard replica, org.opensearch.core.action.ActionListener<TransportReplicationAction.ReplicaResult> listener) Execute the specified replica operation.void
updateGlobalCheckpointForShard
(org.opensearch.core.index.shard.ShardId shardId) Methods inherited from class org.opensearch.action.support.replication.TransportReplicationAction
acquirePrimaryOperationPermit, acquireReplicaOperationPermit, adaptResponse, checkOperationLimits, checkPrimaryLimits, checkReplicaLimits, doExecute, getIndexShard, getReplicationMode, globalBlockLevel, handlePrimaryRequest, handleReplicaRequest, indexBlockLevel, newReplicasProxy, primaryTermValidationReplicasProxy, resolveRequest, retryPrimaryException, setPhase, transportOptions
Methods inherited from class org.opensearch.action.support.TransportAction
execute, execute, execute
-
Field Details
-
ACTION_NAME
-
-
Constructor Details
-
GlobalCheckpointSyncAction
@Inject public GlobalCheckpointSyncAction(Settings settings, TransportService transportService, ClusterService clusterService, IndicesService indicesService, ThreadPool threadPool, ShardStateAction shardStateAction, ActionFilters actionFilters)
-
-
Method Details
-
updateGlobalCheckpointForShard
public void updateGlobalCheckpointForShard(org.opensearch.core.index.shard.ShardId shardId) -
newResponseInstance
protected ReplicationResponse newResponseInstance(org.opensearch.core.common.io.stream.StreamInput in) throws IOException - Specified by:
newResponseInstance
in classTransportReplicationAction<GlobalCheckpointSyncAction.Request,
GlobalCheckpointSyncAction.Request, ReplicationResponse> - Throws:
IOException
-
shardOperationOnPrimary
protected void shardOperationOnPrimary(GlobalCheckpointSyncAction.Request request, IndexShard indexShard, org.opensearch.core.action.ActionListener<TransportReplicationAction.PrimaryResult<GlobalCheckpointSyncAction.Request, ReplicationResponse>> listener) 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
-
shardOperationOnReplica
protected void shardOperationOnReplica(GlobalCheckpointSyncAction.Request shardRequest, IndexShard replica, org.opensearch.core.action.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<GlobalCheckpointSyncAction.Request,
GlobalCheckpointSyncAction.Request, ReplicationResponse> - Parameters:
shardRequest
- the request to the replica shardreplica
- the replica shard to perform the operation on
-