Skip to content

Commit

Permalink
Bugfix: fix continue as new history size (uber#2295)
Browse files Browse the repository at this point in the history
  • Loading branch information
wxing1292 authored Jul 27, 2019
1 parent 5dcef3f commit 66c0c5d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions service/history/workflowExecutionContext.go
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,7 @@ func (c *workflowExecutionContextImpl) updateWorkflowExecutionWithNew(

var newWorkflow *persistence.WorkflowSnapshot
if newContext != nil && newMutableState != nil && newWorkflowTransactionPolicy != nil {

defer func() {
if retError != nil {
newContext.clear()
Expand All @@ -470,17 +471,15 @@ func (c *workflowExecutionContextImpl) updateWorkflowExecutionWithNew(
if err != nil {
return err
}

newWorkflowSizeSize := newContext.getHistorySize()
eventsSize, err := c.persistFirstWorkflowEvents(workflowEventsSeq[0])
if err != nil {
return err
}
newWorkflowSizeSize += eventsSize

newContext.setHistorySize(currentWorkflowSize)
newContext.setHistorySize(newWorkflowSizeSize)
newWorkflow.ExecutionStats = &persistence.ExecutionStats{
HistorySize: currentWorkflowSize,
HistorySize: newWorkflowSizeSize,
}
}

Expand Down

0 comments on commit 66c0c5d

Please sign in to comment.