TestabilityExtensions.MoveSecondaryAsync Method (FabricClient.ServiceManagementClient, String, String, PartitionSelector, Boolean)
Moves selected secondary replica from current node to new node in the cluster.
Namespace: System.Fabric.Testability
Assembly: System.Fabric.Testability (in System.Fabric.Testability.dll)
Syntax
public static Task<MoveSecondaryResult> MoveSecondaryAsync(
this FabricClient.ServiceManagementClient serviceManagementClient,
string currentNodeName,
string newNodeName,
PartitionSelector partitionSelector,
bool ignoreConstraints
)
Parameters
serviceManagementClient
Type: System.Fabric.FabricClient.ServiceManagementClientThe service management fabric client
currentNodeName
Type: System.Stringnode name where selected replica for move is currently present
newNodeName
Type: System.Stringnode name where selected replica to be moved
partitionSelector
Type: System.Fabric.Testability.PartitionSelectorMove Secondary will be called on this Selected Partition.
ignoreConstraints
Type: System.BooleanWhether or not to ignore constraints when attempting to execute the move.
Return Value
Type: System.Threading.Tasks.Task<MoveSecondaryResult>
A task with move secondary result
Exceptions
| Exception | Condition |
|---|---|
| TimeoutException | Retry is exhausted. |
| InvalidOperationException | Invalid operation - If action called on stateless service. - If no active secondary replica exists - If not enough nodes available for action |
| FabricException | FabricErrorCode.AlreadyPrimaryReplica - If Primary replica for selected partition already exist on new node FabricErrorCode.AlreadySecondaryReplica - If active Secondary replica for selected partition already exist on new node FabricErrorCode.InvalidReplicaStateForReplicaOperation - If Current Secondary node is not a secondary replica FabricErrorCode.ConstraintNotSatisfied - If the constraints for the new location of the replica would prohibit the move |
Remarks
API uses the selected secondary replica specified by currentNodeName and moves it to new node location specified by newNodeName. This API is safe i.e. it will not cause quorum or data loss by itself unless additional faults or failures happen at the same time.
See Also
MoveSecondaryAsync Overload
TestabilityExtensions Class
System.Fabric.Testability Namespace
Return to top