153
workflowKey definition.WorkflowKey,
154
versionHistoryItems []*historyspb.VersionHistoryItem,
156
>
if len(versionHistoryItems) == 0 {
157
return serviceerror.NewInvalidArgument("local generated version history items is empty")
158
}
159
>
localVersionHistory, _ := versionhistory.SplitVersionHistoryByLastLocalGeneratedItem(versionHistoryItems, h.clusterMetadata.GetClusterID(), h.clusterMetadata.GetFailoverVersionIncrement())
history_events_handler.go
160
>
lastVersionHistoryItem := localVersionHistory[len(localVersionHistory)-1]
161
>
shardContext, err := h.shardController.GetShardByNamespaceWorkflow(namespace.ID(workflowKey.NamespaceID), workflowKey.WorkflowID)
162
>
if err != nil {
163
return err
164
}
166
>
if err != nil {
167
return err
168
}
170
>
NamespaceId: workflowKey.NamespaceID,
171
>
Execution: &commonpb.WorkflowExecution{
172
>
WorkflowId: workflowKey.WorkflowID,
173
>
RunId: workflowKey.RunID,
174
>
},
175
>
})
176
>
177
>
switch err.(type) {
178
case nil:
179
_, err = versionhistory.FindFirstVersionHistoryIndexByVersionHistoryItem(mu.GetVersionHistories(), lastVersionHistoryItem)