IStateProvider.UpdateEpochAsync(Epoch, Int64, CancellationToken) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Indicates to a replica that the configuration of a replica set has changed due to a change or attempted change to the primary replica. The change occurs due to failure or load balancing of the previous primary replica. Epoch changes act as a barrier by segmenting operations into the exact configuration periods in which they were sent by a specific primary replica.
public System.Threading.Tasks.Task UpdateEpochAsync (System.Fabric.Epoch epoch, long previousEpochLastSequenceNumber, System.Threading.CancellationToken cancellationToken);
abstract member UpdateEpochAsync : System.Fabric.Epoch * int64 * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Function UpdateEpochAsync (epoch As Epoch, previousEpochLastSequenceNumber As Long, cancellationToken As CancellationToken) As Task
Parameters
- previousEpochLastSequenceNumber
- Int64
The maximum sequence number (LSN) in the previous epoch.
- cancellationToken
- CancellationToken
The CancellationToken object that the operation is observing. It can be used to send a notification that the operation should be canceled. Note that cancellation is advisory and that the operation might still be completed even if it is canceled.
Returns
Returns Task.
Remarks
The information in the UpdateEpochAsync(Epoch, Int64, CancellationToken) method enables the service to maintain a progress vector, which is a list of each epoch that the replica has received, and the maximum LSN that they contained.
The progress vector data along with the current applied maximum LSN is useful for a secondary replica to send during the copy operation to describe the state of the replica.
Comparing progress vectors that are received from secondary replicas during the copy operation enables primary replicas to determine whether the secondary replica is up-to-date, what state must be sent to the secondary replica, and whether the secondary replica has made false progress.
False progress means that a secondary replica reports an LSN in a previous epoch was greater than the LSN that the primary replica has in its progress vector.