2037
}
2038
}
2039
>
metrics.CacheMissCounter.With(metricsHandler).Record(1)
client.go
2040
>
2041
>
workflowID := GenerateVersionWorkflowID(deploymentName, buildID)
2042
>
2043
>
// Deterministic UUID v5 RequestId derived from the revision number. Multiple history
2044
>
// pods that independently decide to reactivate the same version at the same revision
2045
>
// compute the same RequestId and fold into a single signal delivery, since the receiver
2046
>
// dedups on RequestId.
2047
>
//
2048
>
// Revision alone is enough input because the dedup is scoped to this one version
2049
>
// workflow (addressed by workflowID); different (deployment, build) pairs at the same
2050
>
// revision don't collide because they're different workflows.
2051
>
requestID := uuid.NewSHA1(
2052
>
uuid.Nil,
2053
>
[]byte("reactivation-signal:"+strconv.FormatInt(revisionNumber, 10)),
2054
>
).String()
2055
>
2056
>
signalRequest := &historyservice.SignalWorkflowExecutionRequest{
2057
>
NamespaceId: namespaceEntry.ID().String(),
2058
>
SignalRequest: &workflowservice.SignalWorkflowExecutionRequest{
2059
>
Namespace: namespaceEntry.Name().String(),
2060
>
WorkflowExecution: &commonpb.WorkflowExecution{
2061
>
WorkflowId: workflowID,
2062
>
},
2063
>
SignalName: ReactivateVersionSignalName,
2064
>
Input: nil,
2065
>
Identity: "history-service",
2066
>
RequestId: requestID,
2067
>
},
2068
>
}
2069
>
2070
>
_, err := d.historyClient.SignalWorkflowExecution(ctx, signalRequest)
2071
>
if err != nil {
2072
return err
2073
}