Skip to content

Commit

Permalink
cdc flow: continue as new after state updates
Browse files Browse the repository at this point in the history
this prevents rewinding state to start of workflow from undoing changes to settings (such as table additions/removals)
  • Loading branch information
serprex committed Jan 9, 2025
1 parent 905c072 commit f638b56
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions flow/workflows/cdc_flow.go
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,7 @@ func CDCFlowWorkflow(

logger.Info(fmt.Sprintf("mirror has been resumed after %s", time.Since(startTime).Round(time.Second)))
state.CurrentFlowStatus = protos.FlowStatus_STATUS_RUNNING
return state, workflow.NewContinueAsNewError(ctx, CDCFlowWorkflow, cfg, state)
}

originalRunID := workflow.GetInfo(ctx).OriginalRunID
Expand Down Expand Up @@ -479,6 +480,7 @@ func CDCFlowWorkflow(
}

state.CurrentFlowStatus = protos.FlowStatus_STATUS_RUNNING
return state, workflow.NewContinueAsNewError(ctx, CDCFlowWorkflow, cfg, state)
}

var finished bool
Expand Down

0 comments on commit f638b56

Please sign in to comment.