Skip to content

Commit

Permalink
Fix CreateWorkflowModeContinueAsNew for SQL (#5413)
Browse files Browse the repository at this point in the history
  • Loading branch information
Shaddoll authored Oct 5, 2023
1 parent 4a26eea commit 765099e
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions common/persistence/sql/sqlExecutionStore.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,13 @@ func (m *sqlExecutionStore) createWorkflowExecutionTx(
}

case p.CreateWorkflowModeContinueAsNew:
// continueAsNew mode expects a current run exists
if err := assertRunIDMismatch(serialization.MustParseUUID(executionInfo.RunID), row.RunID); err != nil {
return nil, err
runIDStr := row.RunID.String()
if runIDStr != request.PreviousRunID {
return nil, &p.CurrentWorkflowConditionFailedError{
Msg: fmt.Sprintf("Workflow execution creation condition failed. WorkflowId: %v, "+
"RunID: %v, PreviousRunID: %v",
workflowID, runIDStr, request.PreviousRunID),
}
}

default:
Expand Down

0 comments on commit 765099e

Please sign in to comment.