Restart-ServiceFabricPartition

Restarts replicas of a Service Fabric partition to simulate a data center blackout or cluster blackout scenario.

Syntax

Restart-ServiceFabricPartition
       -RestartPartitionMode <RestartPartitionMode>
       -PartitionId <Guid>
       -ServiceName <Uri>
       [-TimeoutSec <Int32>]
       [<CommonParameters>]
Restart-ServiceFabricPartition
       -RestartPartitionMode <RestartPartitionMode>
       -ServiceName <Uri>
       [-TimeoutSec <Int32>]
       [<CommonParameters>]
Restart-ServiceFabricPartition
       -RestartPartitionMode <RestartPartitionMode>
       -ServiceName <Uri>
       [-PartitionKindSingleton]
       [-TimeoutSec <Int32>]
       [<CommonParameters>]
Restart-ServiceFabricPartition
       -RestartPartitionMode <RestartPartitionMode>
       -ServiceName <Uri>
       [-PartitionKindNamed]
       -PartitionKey <String>
       [-TimeoutSec <Int32>]
       [<CommonParameters>]
Restart-ServiceFabricPartition
       -RestartPartitionMode <RestartPartitionMode>
       -ServiceName <Uri>
       [-PartitionKindUniformInt64]
       -PartitionKey <String>
       [-TimeoutSec <Int32>]
       [<CommonParameters>]

Description

The Restart-ServiceFabricPartition cmdlet simulates a data center blackout or cluster blackout scenario by restarting some or all of the replicas of a partition. For in-memory services, a restart would result in data loss. For persisted services that restart, no state data should be lost.

Before using this cmdlet, connect to the Service Fabric cluster.

Important note: This cmdlet should not be aborted while running. Aborting this cmdlet while it is running may leave state behind. If this cmdlet is aborted while running, Remove-ServiceFabricTestState should be invoked to remove state that may have been left behind.

Examples

Example 1: Restart a partition

PS C:\> Restart-ServiceFabricPartition -ServiceName fabric:/TestSvc -PartitionKindSingleton -RestartPartitionMode OnlyActiveSecondaries

This command restarts the specified partition.

Example 2: Restart a partition for a specified partition key and partition kind

PS C:\> Restart-ServiceFabricPartition -ServiceName fabric:/TestSvc -PartitionKindUniformInt64 -PartitionKey "23" -RestartPartitionMode AllReplicasOrInstances

This command restarts the partition with partition key 23.

Parameters

-PartitionId

Specifies the ID of the partition to restart.

Type:Guid
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-PartitionKey

Specifies the key of the partition to restart.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-PartitionKindNamed

Indicates that this cmdlet restarts a named partition.

Type:SwitchParameter
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-PartitionKindSingleton

Indicates that this cmdlet restarts a singleton partition.

Type:SwitchParameter
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-PartitionKindUniformInt64

Indicates that this cmdlet restarts a UniformInt64 partition.

Type:SwitchParameter
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-RestartPartitionMode

Specifies whether to restart all replicas in the partition or only secondary partitions.

Type:RestartPartitionMode
Accepted values:Invalid, AllReplicasOrInstances, OnlyActiveSecondaries
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-ServiceName

Specifies the name of the service to restart.

Type:Uri
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-TimeoutSec

Specifies the time-out period, in seconds, for the operation.

Type:Int32
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

System.Guid

System.Uri

System.String

Outputs

System.Object