TestabilityExtensions.MovePrimaryAsync Method (FabricClient.ServiceManagementClient, PartitionSelector, Boolean)

 

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,
    PartitionSelector partitionSelector,
    bool ignoreConstraints
)

Parameters

  • 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. This overload uses random node selected from current node list, where primary replica does not exist at the time of API call for moving primary replica. 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