1392
}
1393
1395
>
ShardID: r.shardContext.GetShardID(),
1396
>
IsNewBranch: isNewBranch,
1397
>
BranchToken: versionHistoryToAppend.BranchToken,
1398
>
History: historyBlob.rawHistory,
1399
>
PrevTransactionID: prevTxnID,
1400
>
TransactionID: txnID,
1401
>
NodeID: historyBlob.nodeID,
1402
>
Info: persistence.BuildHistoryGarbageCleanupInfo(
1403
>
namespaceID.String(),
1404
>
workflowID,
1405
>
runID,
1406
>
),
1407
>
})
1408
>
if err != nil {
1409
return err
1410
}
1412
>
isNewBranch = false
1413
>
1414
>
localMutableState.GetExecutionInfo().ExecutionStats.HistorySize += int64(len(historyBlob.rawHistory.Data))
1415
>
if r.shardContext.GetConfig().ExternalPayloadsEnabled(nsName) {
1416
>
externalPayloadSize, externalPayloadCount, err := workflow.CalculateExternalPayloadSize(
1417
>
events,
1418
>
metrics.NoopMetricsHandler, // don't record metrics since those are not new uploads
1419
>
)
1420
>
if err != nil {
1421
return err
1422
}
1424
>
localMutableState.AddExternalPayloadCount(externalPayloadCount)
1425
}
1426
}
1428
}
1429
// Fill the gap between local last event and request's first event
1430
if len(historyEvents) > 0 && historyEvents[0][0].EventId > startEventID+1 {
1431
>
err := fetchFromRemoteAndAppend(localLastItem.EventId, localLastItem.Version, historyEvents[0][0].EventId, historyEvents[0][0].Version)
workflow_state_replicator.go
1432
>
if err != nil {
1433
return newBranchToken, err
1434
}
1436
>
startEventVersion, err = versionhistory.GetVersionHistoryEventVersion(sourceVersionHistory, startEventID)
1437
>
if err != nil {
1438
return newBranchToken, err
1439
}