836
}
837
839
>
taskEquivalents = make([]tasks.Task, 0, len(r.mutableState.GetPendingActivityInfos())+1)
840
>
taskEquivalents = append(taskEquivalents, &tasks.HistoryReplicationTask{
841
>
// TaskID, VisibilityTimestamp is set by shard
842
>
WorkflowKey: workflowKey,
843
>
FirstEventID: executionInfo.LastFirstEventId,
844
>
NextEventID: nextEventID,
845
>
Version: lastItem.GetVersion(),
846
>
TargetClusters: targetClusters,
847
>
})
848
>
activityIDs := make(map[int64]struct{}, len(r.mutableState.GetPendingActivityInfos()))
849
>
for activityID := range r.mutableState.GetPendingActivityInfos() {
850
>
activityIDs[activityID] = struct{}{}
851
>
}
852
>
taskEquivalents = append(taskEquivalents, convertSyncActivityInfos(
853
>
now,
854
>
workflowKey,
855
>
r.mutableState.GetPendingActivityInfos(),
856
>
activityIDs,
857
>
targetClusters,
858
>
)...)
859
>
taskEquivalents = append(taskEquivalents, &tasks.SyncHSMTask{
860
>
WorkflowKey: workflowKey,
861
>
// TaskID and VisibilityTimestamp are set by shard
862
>
TargetClusters: targetClusters,
863
>
})
864
}
865
867
>
// even though current cluster may enabled state transition, but transition history can be cleared
868
>
// by processing a replication task from a cluster that has state transition disabled
869
>
len(executionInfo.TransitionHistory) > 0 {
870
871
transitionHistory := executionInfo.TransitionHistory