Start-ServiceFabricPartitionDataLoss
Initiates a data loss fault operation on a partition of a stateful Service Fabric service.
Syntax
Start-ServiceFabricPartitionDataLoss
-OperationId <Guid>
-DataLossMode <DataLossMode>
-PartitionId <Guid>
-ServiceName <Uri>
[-TimeoutSec <Int32>]
[<CommonParameters>]
Start-ServiceFabricPartitionDataLoss
-OperationId <Guid>
-DataLossMode <DataLossMode>
-ServiceName <Uri>
[-TimeoutSec <Int32>]
[<CommonParameters>]
Start-ServiceFabricPartitionDataLoss
-OperationId <Guid>
-DataLossMode <DataLossMode>
-ServiceName <Uri>
[-PartitionKindSingleton]
[-TimeoutSec <Int32>]
[<CommonParameters>]
Start-ServiceFabricPartitionDataLoss
-OperationId <Guid>
-DataLossMode <DataLossMode>
-ServiceName <Uri>
[-PartitionKindNamed]
-PartitionKey <String>
[-TimeoutSec <Int32>]
[<CommonParameters>]
Start-ServiceFabricPartitionDataLoss
-OperationId <Guid>
-DataLossMode <DataLossMode>
-ServiceName <Uri>
[-PartitionKindUniformInt64]
-PartitionKey <String>
[-TimeoutSec <Int32>]
[<CommonParameters>]
Description
The Start-ServiceFabricPartitionDataLoss cmdlet initiates a data loss on a stateful service partition in Azure Service Fabric. To run this cmdlet, FaultAnalysisService must be enabled.
Run this cmdlet to perform a data loss fault only for partitions for stateful services. Do not use this cmdlet to perform a data loss for system services.
Different ways to specify the partition on which to invoke data loss are shown in the Syntax section.
You can check the progress of the data loss fault operation using the Get-ServiceFabricPartitionDataLossProgress cmdlet.
After you invoke Start-ServiceFabricPartitionDataLoss, you cannot reverse it.
For details about how to invoke a data loss operation, see Introduction to the Fault Analysis Service.
Examples
Example 1: Start a data loss test for a service by partition ID
PS C:\> Start-ServiceFabricPartitionDataLoss -OperationId d3f12b09-6a90-4745-a4fc-3f92149a7419 -DataLossMode FullDataLoss -PartitionId 67e2c139-ccf0-4562-9f2b-bf35e4c2abd4 -ServiceName "fabric:/ContosoApp/ContosoService"
This command starts a data loss fault operation for all replicas of the service named fabric:/ContosoApp/ContosoService in the partition that has the ID 67e2c139-ccf0-4562-9f2b-bf35e4c2abd4. Specify a unique GUID for the OperationId parameter. You can use this ID to check the progress of the data loss fault operation.
Parameters
-DataLossMode
Specifies the data loss mode for the data loss fault operation. The acceptable values for this parameter are:
- PartialDataLoss. Only a quorum of replicas are removed. OnDataLossAsync is triggered for the partition, but actual data loss depends on the presence of inflight replication.
- FullDataLoss. All replicas are removed. All data is lost and OnDataLossAsync is triggered.
To find more about OnDataLossAsync please refer to the Back up and restore article.
Type: | DataLossMode |
Accepted values: | Invalid, PartialDataLoss, FullDataLoss |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-OperationId
Specifies a unique identifier for this operation. Specify a unique value. If you want to check the progress of the fault, you must pass the OperationId that you used for starting the data loss fault into Get-ServiceFabricPartitionDataLossProgress.
Type: | Guid |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-PartitionId
Specifies the ID of the Service Fabric partition for which this cmdlet starts a data loss fault.
Type: | Guid |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-PartitionKey
Specifies the key of the Service Fabric partition for which this cmdlet starts a data loss fault.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-PartitionKindNamed
Indicates that the Service Fabric partition for which this cmdlet starts a data loss fault is a Named partition.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-PartitionKindSingleton
Indicates that the Service Fabric partition for which this cmdlet starts a data loss fault is a singleton partition.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-PartitionKindUniformInt64
Indicates that the Service Fabric partition for which this cmdlet starts a data loss fault is a UniformInt64 partition.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ServiceName
Specifies the Uniform Resource Identifier (URI) of a Service Fabric service.
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 fault.
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