Restart-ServiceFabricPartition
Restarts replicas of a Service Fabric partition to simulate a data center blackout or cluster blackout scenario.
Syntax
PartitionId
Restart-ServiceFabricPartition
-RestartPartitionMode <RestartPartitionMode>
-PartitionId <Guid>
-ServiceName <Uri>
[-TimeoutSec <Int32>]
[<CommonParameters>]
ServiceNameRandomPartition
Restart-ServiceFabricPartition
-RestartPartitionMode <RestartPartitionMode>
-ServiceName <Uri>
[-TimeoutSec <Int32>]
[<CommonParameters>]
ServiceNamePartitionSingleton
Restart-ServiceFabricPartition
-RestartPartitionMode <RestartPartitionMode>
-ServiceName <Uri>
[-PartitionKindSingleton]
[-TimeoutSec <Int32>]
[<CommonParameters>]
ServiceNamePartitionNamed
Restart-ServiceFabricPartition
-RestartPartitionMode <RestartPartitionMode>
-ServiceName <Uri>
-PartitionKey <String>
[-PartitionKindNamed]
[-TimeoutSec <Int32>]
[<CommonParameters>]
Restart-ServiceFabricPartition
-RestartPartitionMode <RestartPartitionMode>
-ServiceName <Uri>
-PartitionKey <String>
[-PartitionKindUniformInt64]
[-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.
Parameter properties
Type: Guid
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
PartitionId
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-PartitionKey
Specifies the key of the partition to restart.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
ServiceNamePartitionNamed
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
ServiceNamePartitionUniformedInt
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-PartitionKindNamed
Indicates that this cmdlet restarts a named partition.
Parameter properties
Type: SwitchParameter
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
ServiceNamePartitionNamed
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-PartitionKindSingleton
Indicates that this cmdlet restarts a singleton partition.
Parameter properties
Type: SwitchParameter
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
ServiceNamePartitionSingleton
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
Indicates that this cmdlet restarts a UniformInt64 partition.
Type: SwitchParameter
Default value: None
Supports wildcards: False
DontShow: False
ServiceNamePartitionUniformedInt
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-RestartPartitionMode
Specifies whether to restart all replicas in the partition or only secondary partitions.
Parameter properties
Type: RestartPartitionMode
Default value: None
Accepted values: Invalid, AllReplicasOrInstances, OnlyActiveSecondaries
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-ServiceName
Specifies the name of the service to restart.
Parameter properties
Type: Uri
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-TimeoutSec
Specifies the time-out period, in seconds, for the operation.
Parameter properties
Type: Int32
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable,
-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see
about_CommonParameters .
System.Guid
System.Uri
System.String
Outputs
System.Object