TestabilityExtensions.MovePrimaryAsync Method (FabricClient.ServiceManagementClient, String, PartitionSelector, Boolean, TimeSpan, CancellationToken)

 

Moves selected primary replica to new node in the cluster.

Namespace:   System.Fabric.Testability
Assembly:  System.Fabric.Testability (in System.Fabric.Testability.dll)

Syntax

public static Task<MovePrimaryResult> MovePrimaryAsync(
    this FabricClient.ServiceManagementClient serviceManagementClient,
    string nodeName,
    PartitionSelector partitionSelector,
    bool ignoreConstraints,
    TimeSpan operationTimeout,
    CancellationToken token
)

Parameters

  • nodeName
    Type: System.String

    Node name where primary replica to be moved

  • ignoreConstraints
    Type: System.Boolean

    Whether or not to ignore constraints when attempting to execute the move.

Return Value

Type: System.Threading.Tasks.Task<MovePrimaryResult>

A task with move primary result

Exceptions

Exception Condition
TimeoutException

Retry is exhausted.

InvalidOperationException

Invalid operation - If action called on stateless service. - If not enough nodes available for action

FabricException

FabricErrorCode.NotReady - If Primary replica is not ready for movement FabricErrorCode.AlreadyPrimaryReplica - If Primary replica for selected partition already exist on new node FabricErrorCode.ConstraintNotSatisfied - If the constraints for the new location of the replica would prohibit the move

Remarks

API uses the primary replica of the selected partition to move to new node location specified by nodeName. 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

MovePrimaryAsync Overload
TestabilityExtensions Class
System.Fabric.Testability Namespace

Return to top