145
incomingFirstEventID int64,
146
incomingFirstEventVersion int64,
147
>
) (baseBranchToken []byte, retError error) {
resetter.go
148
>
149
>
baseWorkflow, err := r.transactionMgr.LoadWorkflow(
150
>
ctx,
151
>
r.namespaceID,
152
>
r.workflowID,
153
>
r.baseRunID,
154
>
chasm.WorkflowArchetypeID,
155
>
)
156
>
switch err.(type) {
157
>
case nil:
158
>
defer func() {
159
>
baseWorkflow.GetReleaseFn()(retError)
160
>
}()
161
162
>
baseVersionHistories := baseWorkflow.GetMutableState().GetExecutionInfo().GetVersionHistories()
resetter.go
163
>
index, err := versionhistory.FindFirstVersionHistoryIndexByVersionHistoryItem(
164
>
baseVersionHistories,
165
>
versionhistory.NewVersionHistoryItem(baseLastEventID, baseLastEventVersion),
166
>
)
167
>
if err != nil {
168
// the base event and incoming event are from different branch
169
// only re-replicate the gap on the incoming branch