79
}
80
81
>
metricsScope := shardContext.GetMetricsHandler().WithTags(metrics.OperationTag(metrics.HistoryRecordWorkflowTaskStartedScope))
api.go
82
>
83
>
// Check to see if mutable cache is stale in some extreme cassandra failure cases.
84
>
// For speculative and transient WFT scheduledEventID is always ahead of NextEventID.
85
>
// Because there is a clock check above the stack, this should never happen.
86
>
transientWFT := workflowTask.Attempt > 1
87
>
if workflowTask.Type != enumsspb.WORKFLOW_TASK_TYPE_SPECULATIVE && !transientWFT &&
88
>
scheduledEventID >= mutableState.GetNextEventID() {
89
90
metrics.StaleMutableStateCounter.With(metricsScope).Record(1)