Module org.elasticsearch.server
Class ShardStateAction
java.lang.Object
org.elasticsearch.cluster.action.shard.ShardStateAction
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic final recordstatic final classstatic classstatic classstatic classstatic final recordTask that runs on the master node. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionShardStateAction(ClusterService clusterService, TransportService transportService, AllocationService allocationService, RerouteService rerouteService, ThreadPool threadPool) -
Method Summary
Modifier and TypeMethodDescriptionvoidClears outremoteShardStateUpdateDeduplicator.voidlocalShardFailed(ShardRouting shardRouting, String message, Exception failure, ActionListener<Void> listener) Send a shard failed request to the master node to update the cluster state when a shard on the local node failed.voidlocalShardFailed(ShardRouting shardRouting, String message, Exception failure, ActionListener<Void> listener, ClusterState currentState) Send a shard failed request to the master node to update the cluster state when a shard on the local node failed.voidremoteShardFailed(ShardId shardId, String allocationId, long primaryTerm, boolean markAsStale, String message, Exception failure, ActionListener<Void> listener) Send a shard failed request to the master node to update the cluster state with the failure of a shard on another node.voidshardStarted(ShardRouting shardRouting, long primaryTerm, String message, ShardLongFieldRange timestampRange, ShardLongFieldRange eventIngestedRange, ActionListener<Void> listener) voidshardStarted(ShardRouting shardRouting, long primaryTerm, String message, ShardLongFieldRange timestampRange, ShardLongFieldRange eventIngestedRange, ActionListener<Void> listener, ClusterState currentState) protected voidwaitForNewMasterAndRetry(String actionName, ClusterStateObserver observer, TransportRequest request, ActionListener<Void> listener)
-
Field Details
-
SHARD_STARTED_ACTION_NAME
- See Also:
-
SHARD_FAILED_ACTION_NAME
- See Also:
-
-
Constructor Details
-
ShardStateAction
@Inject public ShardStateAction(ClusterService clusterService, TransportService transportService, AllocationService allocationService, RerouteService rerouteService, ThreadPool threadPool)
-
-
Method Details
-
remoteShardFailed
public void remoteShardFailed(ShardId shardId, String allocationId, long primaryTerm, boolean markAsStale, String message, @Nullable Exception failure, ActionListener<Void> listener) Send a shard failed request to the master node to update the cluster state with the failure of a shard on another node. This means that the shard should be failed because a write made it into the primary but was not replicated to this shard copy. If the shard does not exist anymore but still has an entry in the in-sync set, remove its allocation id from the in-sync set.- Parameters:
shardId- shard id of the shard to failallocationId- allocation id of the shard to failprimaryTerm- the primary term associated with the primary shard that is failing the shard. Must be strictly positive.markAsStale- whether or not to mark a failing shard as stale (eg. removing from in-sync set) when failing the shard.message- the reason for the failurefailure- the underlying cause of the failurelistener- callback upon completion of the request
-
clearRemoteShardRequestDeduplicator
public void clearRemoteShardRequestDeduplicator()Clears outremoteShardStateUpdateDeduplicator. Called byIndicesClusterStateServicein case of a master failover to enable sending fresh requests to the new master right away on master failover. This method is best effort in so far that it might clear out valid requests in edge cases during master failover. This is not an issue functionally and merely results in some unnecessary transport requests. -
localShardFailed
public void localShardFailed(ShardRouting shardRouting, String message, @Nullable Exception failure, ActionListener<Void> listener) Send a shard failed request to the master node to update the cluster state when a shard on the local node failed. -
localShardFailed
public void localShardFailed(ShardRouting shardRouting, String message, @Nullable Exception failure, ActionListener<Void> listener, ClusterState currentState) Send a shard failed request to the master node to update the cluster state when a shard on the local node failed. -
waitForNewMasterAndRetry
protected void waitForNewMasterAndRetry(String actionName, ClusterStateObserver observer, TransportRequest request, ActionListener<Void> listener) -
shardStarted
public void shardStarted(ShardRouting shardRouting, long primaryTerm, String message, ShardLongFieldRange timestampRange, ShardLongFieldRange eventIngestedRange, ActionListener<Void> listener) -
shardStarted
public void shardStarted(ShardRouting shardRouting, long primaryTerm, String message, ShardLongFieldRange timestampRange, ShardLongFieldRange eventIngestedRange, ActionListener<Void> listener, ClusterState currentState)
-