Share via


FabricClient.ServiceManagementClient.RemoveReplicaAsync Method

Definition

Overloads

Name Description
RemoveReplicaAsync(String, Guid, Int64, Boolean, TimeSpan, CancellationToken)
Obsolete.

Removes a service replica 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 TimeoutException and cancellation-token that the operation is observing.

RemoveReplicaAsync(String, Guid, Int64, RemoveReplicaOptions, TimeSpan, CancellationToken)
RemoveReplicaAsync(String, Guid, Int64, TimeSpan, CancellationToken)
Obsolete.

Removes a service replica 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 TimeoutException and cancellation-token that the operation is observing.

RemoveReplicaAsync(String, Guid, Int64, Boolean)
Obsolete.

Removes a service replica running on a node.

RemoveReplicaAsync(String, Guid, Int64)
Obsolete.

Removes a service replica running on a node.

RemoveReplicaAsync(String, Guid, Int64, RemoveReplicaOptions)

RemoveReplicaAsync(String, Guid, Int64, Boolean, TimeSpan, CancellationToken)

Caution

This api is deprecated, use overload taking RemoveReplicaOptions instead.

Removes a service replica 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 TimeoutException and cancellation-token that the operation is observing.

[System.Obsolete("This api is deprecated, use overload taking RemoveReplicaOptions instead.", false)]
public System.Threading.Tasks.Task RemoveReplicaAsync(string nodeName, Guid partitionId, long replicaOrInstanceId, bool forceRemove, TimeSpan timeout, System.Threading.CancellationToken cancellationToken);
[<System.Obsolete("This api is deprecated, use overload taking RemoveReplicaOptions instead.", false)>]
member this.RemoveReplicaAsync : string * Guid * int64 * bool * TimeSpan * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Function RemoveReplicaAsync (nodeName As String, partitionId As Guid, replicaOrInstanceId As Long, forceRemove As Boolean, timeout As TimeSpan, cancellationToken As CancellationToken) As Task

Parameters

nodeName
String

The name of the node.

partitionId
Guid

The partition identifier.

replicaOrInstanceId
Int64

The instance identifier.

forceRemove
Boolean

Specifies whether the replica should be given a chance to gracefully clean up its state and close

timeout
TimeSpan

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

cancellationToken
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

A Task representing the acknowledgment of the request.

Attributes

Exceptions

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.

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

If nodeName is null or empty.

Remarks

This API gives a running replica the chance to cleanup its state and be gracefully shutdown.

If the forceRemove flag is set then no such opportunity is given. Service Fabric will terminate the host for that replica and any persisted state of that replica will be leaked.

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

In addition, the forceRemove flag impacts all other replicas hosted in the same process.

Applies to

RemoveReplicaAsync(String, Guid, Int64, RemoveReplicaOptions, TimeSpan, CancellationToken)

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

Parameters

nodeName
String
partitionId
Guid
replicaOrInstanceId
Int64
removeReplicaOptions
RemoveReplicaOptions
timeout
TimeSpan
cancellationToken
CancellationToken

Returns

Applies to

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

Caution

This api is deprecated, use overload taking RemoveReplicaOptions instead.

Removes a service replica 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 TimeoutException and cancellation-token that the operation is observing.

[System.Obsolete("This api is deprecated, use overload taking RemoveReplicaOptions instead.", false)]
public System.Threading.Tasks.Task RemoveReplicaAsync(string nodeName, Guid partitionId, long replicaOrInstanceId, TimeSpan timeout, System.Threading.CancellationToken cancellationToken);
[<System.Obsolete("This api is deprecated, use overload taking RemoveReplicaOptions instead.", false)>]
member this.RemoveReplicaAsync : string * Guid * int64 * TimeSpan * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Function RemoveReplicaAsync (nodeName As String, partitionId As Guid, replicaOrInstanceId As Long, timeout As TimeSpan, cancellationToken As CancellationToken) As Task

Parameters

nodeName
String

The name of the node.

partitionId
Guid

The partition identifier.

replicaOrInstanceId
Int64

The instance identifier.

timeout
TimeSpan

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

cancellationToken
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

A Task representing the acknowledgment of the request.

Attributes

Exceptions

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.

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

If nodeName is null or empty.

Remarks

This API gives a running replica the chance to cleanup its state and be gracefully shutdown.

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

Applies to

RemoveReplicaAsync(String, Guid, Int64, Boolean)

Caution

This api is deprecated, use overload taking RemoveReplicaOptions instead.

Removes a service replica running on a node.

[System.Obsolete("This api is deprecated, use overload taking RemoveReplicaOptions instead.", false)]
public System.Threading.Tasks.Task RemoveReplicaAsync(string nodeName, Guid partitionId, long replicaOrInstanceId, bool forceRemove);
[<System.Obsolete("This api is deprecated, use overload taking RemoveReplicaOptions instead.", false)>]
member this.RemoveReplicaAsync : string * Guid * int64 * bool -> System.Threading.Tasks.Task
Public Function RemoveReplicaAsync (nodeName As String, partitionId As Guid, replicaOrInstanceId As Long, forceRemove As Boolean) As Task

Parameters

nodeName
String

The name of the node.

partitionId
Guid

The partition identifier.

replicaOrInstanceId
Int64

The instance identifier.

forceRemove
Boolean

Specifies whether the replica should be given a chance to gracefully clean up its state and close

Returns

A Task representing the acknowledgment of the request.

Attributes

Exceptions

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.

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

If nodeName is null or empty.

Remarks

This API gives a running replica the chance to cleanup its state and be gracefully shutdown.

If the forceRemove flag is set then no such opportunity is given. Service Fabric will terminate the host for that replica and any persisted state of that replica will be leaked.

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

In addition, the forceRemove flag impacts all other replicas hosted in the same process.

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

Applies to

RemoveReplicaAsync(String, Guid, Int64)

Caution

This api is deprecated, use overload taking RemoveReplicaOptions instead.

Removes a service replica running on a node.

[System.Obsolete("This api is deprecated, use overload taking RemoveReplicaOptions instead.", false)]
public System.Threading.Tasks.Task RemoveReplicaAsync(string nodeName, Guid partitionId, long replicaOrInstanceId);
[<System.Obsolete("This api is deprecated, use overload taking RemoveReplicaOptions instead.", false)>]
member this.RemoveReplicaAsync : string * Guid * int64 -> System.Threading.Tasks.Task
Public Function RemoveReplicaAsync (nodeName As String, partitionId As Guid, replicaOrInstanceId As Long) As Task

Parameters

nodeName
String

The name of the node.

partitionId
Guid

The partition identifier.

replicaOrInstanceId
Int64

The instance identifier.

Returns

A Task representing the acknowledgment of the request.

Attributes

Exceptions

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.

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

If nodeName is null or empty.

Remarks

This API gives a running replica the chance to cleanup its state and be gracefully shutdown.

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

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

Applies to

RemoveReplicaAsync(String, Guid, Int64, RemoveReplicaOptions)

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

Parameters

nodeName
String
partitionId
Guid
replicaOrInstanceId
Int64
removeReplicaOptions
RemoveReplicaOptions

Returns

Applies to