Start-​Service​Fabric​Partition​Data​Loss

Initiates a data loss fault operation on a partition of a stateful Service Fabric service. For details about how to invoke a data loss operation, see the Invoke Data Loss (https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-use-data-loss-api)article. The various ways to specify or to choose the partition to invoke data loss on are below.

Syntax

Start-ServiceFabricPartitionDataLoss
     -DataLossMode <DataLossMode>
     -OperationId <Guid>
     -PartitionId <Guid>
     -ServiceName <Uri>
     [-TimeoutSec <Int32>]
     [<CommonParameters>]
Start-ServiceFabricPartitionDataLoss
     -DataLossMode <DataLossMode>
     -OperationId <Guid>
     -PartitionKey <String>
     [-PartitionKindNamed]
     -ServiceName <Uri>
     [-TimeoutSec <Int32>]
     [<CommonParameters>]
Start-ServiceFabricPartitionDataLoss
     -DataLossMode <DataLossMode>
     -OperationId <Guid>
     -PartitionKey <String>
     [-PartitionKindUniformInt64]
     -ServiceName <Uri>
     [-TimeoutSec <Int32>]
     [<CommonParameters>]
Start-ServiceFabricPartitionDataLoss
     -DataLossMode <DataLossMode>
     -OperationId <Guid>
     [-PartitionKindSingleton]
     -ServiceName <Uri>
     [-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.

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.

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.

Required 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
Parameter Sets:Invalid, PartialDataLoss, FullDataLoss
Position:Named
Default value:None
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
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
Accept pipeline input:True (ByPropertyName)
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
Accept pipeline input:True (ByPropertyName)
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
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
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
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
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False

Optional Parameters

-TimeoutSec

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

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