Restart-​Service​Fabric​Partition

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

Syntax

Restart-ServiceFabricPartition
       -PartitionId <Guid>
       -RestartPartitionMode <RestartPartitionMode>
       -ServiceName <Uri>
       [-TimeoutSec <Int32>]
       [<CommonParameters>]
Restart-ServiceFabricPartition
       -PartitionKey <String>
       [-PartitionKindNamed]
       -RestartPartitionMode <RestartPartitionMode>
       -ServiceName <Uri>
       [-TimeoutSec <Int32>]
       [<CommonParameters>]
Restart-ServiceFabricPartition
       -PartitionKey <String>
       [-PartitionKindUniformInt64]
       -RestartPartitionMode <RestartPartitionMode>
       -ServiceName <Uri>
       [-TimeoutSec <Int32>]
       [<CommonParameters>]
Restart-ServiceFabricPartition
       [-PartitionKindSingleton]
       -RestartPartitionMode <RestartPartitionMode>
       -ServiceName <Uri>
       [-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.

Required Parameters

-PartitionId

Specifies the ID of the partition to restart.

Type:Guid
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-PartitionKey

Specifies the key of the partition to restart.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-PartitionKindNamed

Indicates that this cmdlet restarts a named partition.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-PartitionKindSingleton

Indicates that this cmdlet restarts a singleton partition.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-PartitionKindUniformInt64

Indicates that this cmdlet restarts a UniformInt64 partition.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-RestartPartitionMode

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

Type:RestartPartitionMode
Parameter Sets:Invalid, AllReplicasOrInstances, OnlyActiveSecondaries
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ServiceName

Specifies the name of the service to restart.

Type:Uri
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False

Optional Parameters

-TimeoutSec

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

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

Inputs

System.Uri

Inputs

System.Guid

Outputs

System.Object