Skip to content

Commit

Permalink
swapping order of addpub and ensurepullability
Browse files Browse the repository at this point in the history
  • Loading branch information
heavycrystal committed Feb 19, 2024
1 parent d984ff5 commit ebca80a
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions flow/workflows/cdc_flow.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,18 +152,6 @@ func (w *CDCFlowWorkflowExecution) processCDCFlowConfigUpdates(ctx workflow.Cont
continue
}

alterPublicationAddAdditionalTablesCtx := workflow.WithActivityOptions(ctx, workflow.ActivityOptions{
StartToCloseTimeout: 5 * time.Minute,
})
alterPublicationAddAdditionalTablesFuture := workflow.ExecuteActivity(
alterPublicationAddAdditionalTablesCtx,
flowable.AddTablesToPublication,
cfg, flowConfigUpdate.AdditionalTables)
if err := alterPublicationAddAdditionalTablesFuture.Get(ctx, nil); err != nil {
w.logger.Error("failed to alter publication for additional tables: ", err)
return err
}

ensurePullabilityCtx := workflow.WithActivityOptions(ctx, workflow.ActivityOptions{
StartToCloseTimeout: 5 * time.Minute,
})
Expand All @@ -187,6 +175,18 @@ func (w *CDCFlowWorkflowExecution) processCDCFlowConfigUpdates(ctx workflow.Cont
return err
}

alterPublicationAddAdditionalTablesCtx := workflow.WithActivityOptions(ctx, workflow.ActivityOptions{
StartToCloseTimeout: 5 * time.Minute,
})
alterPublicationAddAdditionalTablesFuture := workflow.ExecuteActivity(
alterPublicationAddAdditionalTablesCtx,
flowable.AddTablesToPublication,
cfg, flowConfigUpdate.AdditionalTables)
if err := alterPublicationAddAdditionalTablesFuture.Get(ctx, nil); err != nil {
w.logger.Error("failed to alter publication for additional tables: ", err)
return err
}

additionalTablesWorkflowCfg := proto.Clone(cfg).(*protos.FlowConnectionConfigs)
additionalTablesWorkflowCfg.DoInitialSnapshot = true
additionalTablesWorkflowCfg.InitialSnapshotOnly = true
Expand Down

0 comments on commit ebca80a

Please sign in to comment.