Skip to content

Commit

Permalink
deprecated TransitionTypeBarrier (flyteorg#336)
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Rammer <[email protected]>
  • Loading branch information
hamersaw authored Apr 7, 2023
1 parent d787873 commit b101e65
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions flyteplugins/go/tasks/pluginmachinery/core/transition.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const (
// The transition is eventually consistent. For all the state written may not be visible in the next call, but eventually will persist
// Best to use when the plugin logic is completely idempotent. This is also the most performant option.
TransitionTypeEphemeral TransitionType = iota
// @deprecated support for Barrier type transitions has been deprecated
// This transition tries its best to make the latest state visible for every consecutive read. But, it is possible
// to go back in time, i.e. monotonic consistency is violated (in rare cases).
TransitionTypeBarrier
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func (c CorePlugin) Handle(ctx context.Context, tCtx core.TaskExecutionContext)
return core.UnknownTransition, err
}

return core.DoTransitionType(core.TransitionTypeBarrier, phaseInfo), nil
return core.DoTransition(phaseInfo), nil
}

func (c CorePlugin) Abort(ctx context.Context, tCtx core.TaskExecutionContext) error {
Expand Down
2 changes: 1 addition & 1 deletion flyteplugins/go/tasks/plugins/array/k8s/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ func (e Executor) Handle(ctx context.Context, tCtx core.TaskExecutionContext) (c
return core.UnknownTransition, err
}

return core.DoTransitionType(core.TransitionTypeBarrier, phaseInfo), nil
return core.DoTransition(phaseInfo), nil
}

func (e Executor) Abort(ctx context.Context, tCtx core.TaskExecutionContext) error {
Expand Down
2 changes: 1 addition & 1 deletion flyteplugins/go/tasks/plugins/hive/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func (q QuboleHiveExecutor) Handle(ctx context.Context, tCtx core.TaskExecutionC
return core.UnknownTransition, err
}

return core.DoTransitionType(core.TransitionTypeBarrier, phaseInfo), nil
return core.DoTransition(phaseInfo), nil
}

func (q QuboleHiveExecutor) Abort(ctx context.Context, tCtx core.TaskExecutionContext) error {
Expand Down
2 changes: 1 addition & 1 deletion flyteplugins/go/tasks/plugins/presto/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func (p Executor) Handle(ctx context.Context, tCtx core.TaskExecutionContext) (c
return core.UnknownTransition, err
}

return core.DoTransitionType(core.TransitionTypeBarrier, phaseInfo), nil
return core.DoTransition(phaseInfo), nil
}

func (p Executor) Abort(ctx context.Context, tCtx core.TaskExecutionContext) error {
Expand Down
2 changes: 1 addition & 1 deletion flyteplugins/tests/end_to_end.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ func RunPluginEndToEndTest(t *testing.T, executor pluginCore.Plugin, template *i
tCtx.OnMaxDatasetSizeBytes().Return(1000000)
tCtx.OnSecretManager().Return(secretManager)

trns := pluginCore.DoTransitionType(pluginCore.TransitionTypeBarrier, pluginCore.PhaseInfoQueued(time.Now(), 0, ""))
trns := pluginCore.DoTransition(pluginCore.PhaseInfoQueued(time.Now(), 0, ""))
for !trns.Info().Phase().IsTerminal() {
trns, err = executor.Handle(ctx, tCtx)
assert.NoError(t, err)
Expand Down

0 comments on commit b101e65

Please sign in to comment.