FabricClient.ServiceManagementClient.RestartReplicaAsync Method

Definition

Overloads

RestartReplicaAsync(String, Guid, Int64)

Restarts a service replica of a persisted service running on a node.

RestartReplicaAsync(String, Guid, Int64, TimeSpan, CancellationToken)

Restarts a service replica of a persisted service running on a node. Also takes in timeout interval, which is the maximum of time the system will allow this operation to continue before returning System.TimeoutException and cancellation-token that the operation is observing.

RestartReplicaAsync(String, Guid, Int64)

Restarts a service replica of a persisted service running on a node.

public System.Threading.Tasks.Task RestartReplicaAsync (string nodeName, Guid partitionId, long replicaOrInstanceId);
member this.RestartReplicaAsync : string * Guid * int64 -> System.Threading.Tasks.Task
Public Function RestartReplicaAsync (nodeName As String, partitionId As Guid, replicaOrInstanceId As Long) As Task

Parameters

nodeName
System.String

The name of the node.

partitionId
System.Guid

The partition identifier.

replicaOrInstanceId
System.Int64

The instance identifier.

Returns

System.Threading.Tasks.Task

A Task representing the acknowledgment of the request.

Exceptions

System.TimeoutException

See https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-errors-and-exceptions for handling common FabricClient failures.

ReplicaDoesNotExist is returned if the replica or instance id is not running on the node.

InvalidReplicaStateForReplicaOperation is returned if the replica or instance id cannot be restarted or removed at this time as it is in an invalid state. For example, the replica is already in the process of being closed.

InvalidReplicaOperation is returned if the replica does not belong to a stateful persisted service. Only stateful persisted replicas can be restarted.

See also https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-errors-and-exceptions for handling common FabricClient failures.

System.ArgumentException

If nodeName is null or empty.

Remarks

WARNING: There are no safety checks performed when this API is used. Incorrect use of this API can lead to availability loss for stateful services.

The default timeout is one minute for which the system will allow this operation to continue before returning System.TimeoutException.

Applies to

RestartReplicaAsync(String, Guid, Int64, TimeSpan, CancellationToken)

Restarts a service replica of a persisted service running on a node. Also takes in timeout interval, which is the maximum of time the system will allow this operation to continue before returning System.TimeoutException and cancellation-token that the operation is observing.

public System.Threading.Tasks.Task RestartReplicaAsync (string nodeName, Guid partitionId, long replicaOrInstanceId, TimeSpan timeout, System.Threading.CancellationToken cancellationToken);
member this.RestartReplicaAsync : string * Guid * int64 * TimeSpan * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Function RestartReplicaAsync (nodeName As String, partitionId As Guid, replicaOrInstanceId As Long, timeout As TimeSpan, cancellationToken As CancellationToken) As Task

Parameters

nodeName
System.String

The name of the node.

partitionId
System.Guid

The partition identifier.

replicaOrInstanceId
System.Int64

The instance identifier.

timeout
System.TimeSpan

The timespan that defines the maximum amount of time will allow this operation to continue before returning a System.TimeoutException.

cancellationToken
System.Threading.CancellationToken

The optional cancellation token that the operation is observing. It can be used to send a notification that the operation should be canceled. Note that cancellation is advisory and that the operation may still be completed even if it is cancelled.

Returns

System.Threading.Tasks.Task

A Task representing the acknowledgment of the request.

Exceptions

System.TimeoutException

See https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-errors-and-exceptions for handling common FabricClient failures.

ReplicaDoesNotExist is returned if the replica or instance id is not running on the node.

InvalidReplicaStateForReplicaOperation is returned if the replica or instance id cannot be restarted or removed at this time as it is in an invalid state. For example, the replica is already in the process of being closed.

InvalidReplicaOperation is returned if the replica does not belong to a stateful persisted service. Only stateful persisted replicas can be restarted.

See also https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-errors-and-exceptions for handling common FabricClient failures.

System.ArgumentException

If nodeName is null or empty.

Remarks

WARNING: There are no safety checks performed when this API is used. Incorrect use of this API can lead to availability loss for stateful services.

Applies to