JavaScript is disabled on your browser.
Nested Class Summary
Nested Classes
protected static final class
Internal request for concrete replica
static class
a wrapper class to encapsulate a request when being sent to a specific allocation id
static class
static class
static class
protected class
The ReplicasProxy
is an implementation of the Replicas
interface that performs the actual ReplicaRequest
on the replica
shards.
static class
Thrown if there are any errors retrying on the replica
Field Summary
Fields
protected final boolean
Making primary and replica actions suffixes as constant
static final Setting <org.opensearch.common.unit.TimeValue>
The maximum bound for the first retry backoff for failed replication operations.
static final Setting <org.opensearch.common.unit.TimeValue>
The timeout for retrying replication requests.
Constructor Summary
Constructors
protected
TransportReplicationAction (Settings settings,
String actionName,
TransportService transportService,
ClusterService clusterService,
IndicesService indicesService,
ThreadPool threadPool,
ShardStateAction shardStateAction,
ActionFilters actionFilters,
org.opensearch.core.common.io.stream.Writeable.Reader<Request > requestReader,
org.opensearch.core.common.io.stream.Writeable.Reader<ReplicaRequest > replicaRequestReader,
String executor)
protected
TransportReplicationAction (Settings settings,
String actionName,
TransportService transportService,
ClusterService clusterService,
IndicesService indicesService,
ThreadPool threadPool,
ShardStateAction shardStateAction,
ActionFilters actionFilters,
org.opensearch.core.common.io.stream.Writeable.Reader<Request > requestReader,
org.opensearch.core.common.io.stream.Writeable.Reader<ReplicaRequest > replicaRequestReader,
String executor,
boolean syncGlobalCheckpointAfterOperation,
boolean forceExecutionOnPrimary)
protected
TransportReplicationAction (Settings settings,
String actionName,
TransportService transportService,
ClusterService clusterService,
IndicesService indicesService,
ThreadPool threadPool,
ShardStateAction shardStateAction,
ActionFilters actionFilters,
org.opensearch.core.common.io.stream.Writeable.Reader<Request > requestReader,
org.opensearch.core.common.io.stream.Writeable.Reader<ReplicaRequest > replicaRequestReader,
String executor,
boolean syncGlobalCheckpointAfterOperation,
boolean forceExecutionOnPrimary,
AdmissionControlActionType admissionControlActionType)
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods
protected void
Executes the logic for acquiring one or more operation permit on a primary shard.
protected void
Executes the logic for acquiring one or more operation permit on a replica shard.
protected void
protected org.opensearch.common.lease.Releasable
protected org.opensearch.common.lease.Releasable
protected org.opensearch.common.lease.Releasable
protected void
Cluster level block to check before request execution.
protected void
protected void
Index level block to check before request execution.
This returns a ReplicaProxy that is used for primary term validation.
protected void
Resolves derived values in the request.
protected boolean
protected static void
Sets the current phase on the task if it isn't null.
protected abstract void
Primary operation on node with primary copy.
protected abstract void
Execute the specified replica operation.
Methods inherited from class java.lang.Object
clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait
Field Details
REPLICATION_RETRY_TIMEOUT
public static final Setting <org.opensearch.common.unit.TimeValue> REPLICATION_RETRY_TIMEOUT
The timeout for retrying replication requests.
REPLICATION_INITIAL_RETRY_BACKOFF_BOUND
public static final Setting <org.opensearch.common.unit.TimeValue> REPLICATION_INITIAL_RETRY_BACKOFF_BOUND
The maximum bound for the first retry backoff for failed replication operations. The backoff bound
will increase exponential if failures continue.
PRIMARY_ACTION_SUFFIX
public static final String PRIMARY_ACTION_SUFFIX
Making primary and replica actions suffixes as constant
See Also:
REPLICA_ACTION_SUFFIX
public static final String REPLICA_ACTION_SUFFIX
See Also:
executor
protected final String executor
forceExecutionOnPrimary
protected final boolean forceExecutionOnPrimary
transportReplicaAction
protected final String transportReplicaAction
transportPrimaryAction
protected final String transportPrimaryAction
Constructor Details
TransportReplicationAction
protected TransportReplicationAction (Settings settings,
String actionName,
TransportService transportService,
ClusterService clusterService,
IndicesService indicesService,
ThreadPool threadPool,
ShardStateAction shardStateAction,
ActionFilters actionFilters,
org.opensearch.core.common.io.stream.Writeable.Reader<Request > requestReader,
org.opensearch.core.common.io.stream.Writeable.Reader<ReplicaRequest > replicaRequestReader,
String executor)
TransportReplicationAction
protected TransportReplicationAction (Settings settings,
String actionName,
TransportService transportService,
ClusterService clusterService,
IndicesService indicesService,
ThreadPool threadPool,
ShardStateAction shardStateAction,
ActionFilters actionFilters,
org.opensearch.core.common.io.stream.Writeable.Reader<Request > requestReader,
org.opensearch.core.common.io.stream.Writeable.Reader<ReplicaRequest > replicaRequestReader,
String executor,
boolean syncGlobalCheckpointAfterOperation,
boolean forceExecutionOnPrimary)
TransportReplicationAction
protected TransportReplicationAction (Settings settings,
String actionName,
TransportService transportService,
ClusterService clusterService,
IndicesService indicesService,
ThreadPool threadPool,
ShardStateAction shardStateAction,
ActionFilters actionFilters,
org.opensearch.core.common.io.stream.Writeable.Reader<Request > requestReader,
org.opensearch.core.common.io.stream.Writeable.Reader<ReplicaRequest > replicaRequestReader,
String executor,
boolean syncGlobalCheckpointAfterOperation,
boolean forceExecutionOnPrimary,
AdmissionControlActionType admissionControlActionType)
Method Details
primaryTermValidationReplicasProxy
This returns a ReplicaProxy that is used for primary term validation. The default behavior is that the control
must not reach inside the performOn method for ReplicationActions. However, the implementations of the underlying
class can provide primary term validation proxy that can allow performOn method to make calls to replica.
Returns:
Primary term validation replicas proxy.
getReplicationMode
Parameters:
indexShard
- index shard used to determining the policy.
Returns:
the overridden replication mode.
shardOperationOnPrimary
Primary operation on node with primary copy.
Parameters:
shardRequest
- the request to the primary shard
primary
- the primary shard to perform the operation on
shardOperationOnReplica
Parameters:
shardRequest
- the request to the replica shard
replica
- the replica shard to perform the operation on
globalBlockLevel
Cluster level block to check before request execution. Returning null means that no blocks need to be checked.
indexBlockLevel
Index level block to check before request execution. Returning null means that no blocks need to be checked.
retryPrimaryException
protected boolean retryPrimaryException (Throwable e)
checkOperationLimits
protected org.opensearch.common.lease.Releasable checkOperationLimits (Request request)
checkPrimaryLimits
protected org.opensearch.common.lease.Releasable checkPrimaryLimits (Request request,
boolean rerouteWasLocal,
boolean localRerouteInitiatedByNodeClient)
checkReplicaLimits
protected org.opensearch.common.lease.Releasable checkReplicaLimits (ReplicaRequest request)
getIndexShard
protected IndexShard getIndexShard (org.opensearch.core.index.shard.ShardId shardId)
acquirePrimaryOperationPermit
protected void acquirePrimaryOperationPermit (IndexShard primary,
Request request,
org.opensearch.core.action.ActionListener<org.opensearch.common.lease.Releasable> onAcquired)
Executes the logic for acquiring one or more operation permit on a primary shard. The default is to acquire a single permit but this
method can be overridden to acquire more.
acquireReplicaOperationPermit
protected void acquireReplicaOperationPermit (IndexShard replica,
ReplicaRequest request,
org.opensearch.core.action.ActionListener<org.opensearch.common.lease.Releasable> onAcquired,
long primaryTerm,
long globalCheckpoint,
long maxSeqNoOfUpdatesOrDeletes)
Executes the logic for acquiring one or more operation permit on a replica shard. The default is to acquire a single permit but this
method can be overridden to acquire more.
setPhase
Sets the current phase on the task if it isn't null. Pulled into its own
method because its more convenient that way.