Share via


StatefulServiceDescription.HasPersistedState Property

 

Applies To: Azure, Windows 10, Windows 8, Windows 8.1, Windows Server 2012 R2

Gets or sets a value indicating whether this instance has persisted state.

Namespace:   System.Fabric.Description
Assembly:  System.Fabric (in System.Fabric.dll)

Syntax

public bool HasPersistedState { get; set; }

Property Value

Type: System.Boolean

true if the instance has persisted state; otherwise, false.

Remarks

When a FabricReplicator at a secondary replica receives an operation for a persistent service, it must wait for the service to acknowledge that the data has been persisted before it can send that acknowledgment back to the primary. For non-persistent services, the operation can be acknowledged immediately upon receipt.

When a persistent service replica fails, the Service Fabric will not immediately consider that replica as lost because the persistent state for that replica still exists. If the replica is recovered, it can be recreated using the persisted state. In contrast, beginning to build a replacement replica immediately may be costly and unnecessary, especially when the failures are transient. To configure how long Service Fabric should wait for the persistent replica to recover before building a new (replacement) replica from scratch, use the ReplicaRestartWaitDuration parameter. For non-persistent services (those with HasPersistedState set to false), Service Fabric will immediately begin creating a new replica (since there is no persistent state to recover from, and hence no point in waiting for local recovery).

See Also

StatefulServiceDescription Class
System.Fabric.Description Namespace

Return to top