Skip to content

Commit

Permalink
Bugfix: continue as new replication task processing should load only …
Browse files Browse the repository at this point in the history
…the first event batch (#2156)
  • Loading branch information
wxing1292 authored Jul 2, 2019
1 parent c3f265f commit 1b9ac8d
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions service/history/replicatorQueueProcessor.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,20 @@ func GenerateReplicationTask(targetClusters []string, task *persistence.Replicat
if lastEvent.GetEventType() == shared.EventTypeWorkflowExecutionContinuedAsNew {
// Check if this is replication task for ContinueAsNew event, then retrieve the history for new execution
newRunID := lastEvent.WorkflowExecutionContinuedAsNewEventAttributes.GetNewExecutionRunId()
newRunHistory, _, err = GetAllHistory(historyMgr, historyV2Mgr, metricsClient, logger, false,
task.DomainID, task.WorkflowID, newRunID, common.FirstEventID, int64(3), task.NewRunEventStoreVersion, task.NewRunBranchToken, shardID)
newRunHistory, _, err = GetAllHistory(
historyMgr,
historyV2Mgr,
metricsClient,
logger,
false,
task.DomainID,
task.WorkflowID,
newRunID,
common.FirstEventID,
common.FirstEventID+1, // [common.FirstEventID to common.FirstEventID+1) will get the first batch
task.NewRunEventStoreVersion,
task.NewRunBranchToken,
shardID)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 1b9ac8d

Please sign in to comment.