From 1fc603bddeb0be2f17809f2f43dcf1700c94ed60 Mon Sep 17 00:00:00 2001 From: Daniel Rammer Date: Tue, 26 Sep 2023 11:27:35 -0500 Subject: [PATCH] Revert "deprecated TransitionTypeBarrier (#336)" This reverts commit 4f02c2ca8d461538e43a1cd6250bcfd23cd448c4. Signed-off-by: Daniel Rammer --- go/tasks/pluginmachinery/core/transition.go | 1 - go/tasks/pluginmachinery/internal/webapi/core.go | 2 +- go/tasks/plugins/array/k8s/executor.go | 2 +- go/tasks/plugins/hive/executor.go | 2 +- go/tasks/plugins/presto/executor.go | 2 +- tests/end_to_end.go | 2 +- 6 files changed, 5 insertions(+), 6 deletions(-) diff --git a/go/tasks/pluginmachinery/core/transition.go b/go/tasks/pluginmachinery/core/transition.go index fe7503f15..28f06884e 100644 --- a/go/tasks/pluginmachinery/core/transition.go +++ b/go/tasks/pluginmachinery/core/transition.go @@ -11,7 +11,6 @@ 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 diff --git a/go/tasks/pluginmachinery/internal/webapi/core.go b/go/tasks/pluginmachinery/internal/webapi/core.go index 049fc431a..6d506af19 100644 --- a/go/tasks/pluginmachinery/internal/webapi/core.go +++ b/go/tasks/pluginmachinery/internal/webapi/core.go @@ -97,7 +97,7 @@ func (c CorePlugin) Handle(ctx context.Context, tCtx core.TaskExecutionContext) return core.UnknownTransition, err } - return core.DoTransition(phaseInfo), nil + return core.DoTransitionType(core.TransitionTypeBarrier, phaseInfo), nil } func (c CorePlugin) Abort(ctx context.Context, tCtx core.TaskExecutionContext) error { diff --git a/go/tasks/plugins/array/k8s/executor.go b/go/tasks/plugins/array/k8s/executor.go index 79da214f3..d70d3a606 100644 --- a/go/tasks/plugins/array/k8s/executor.go +++ b/go/tasks/plugins/array/k8s/executor.go @@ -148,7 +148,7 @@ func (e Executor) Handle(ctx context.Context, tCtx core.TaskExecutionContext) (c return core.UnknownTransition, err } - return core.DoTransition(phaseInfo), nil + return core.DoTransitionType(core.TransitionTypeBarrier, phaseInfo), nil } func (e Executor) Abort(ctx context.Context, tCtx core.TaskExecutionContext) error { diff --git a/go/tasks/plugins/hive/executor.go b/go/tasks/plugins/hive/executor.go index a07f7b515..80a03d9e3 100644 --- a/go/tasks/plugins/hive/executor.go +++ b/go/tasks/plugins/hive/executor.go @@ -65,7 +65,7 @@ func (q QuboleHiveExecutor) Handle(ctx context.Context, tCtx core.TaskExecutionC return core.UnknownTransition, err } - return core.DoTransition(phaseInfo), nil + return core.DoTransitionType(core.TransitionTypeBarrier, phaseInfo), nil } func (q QuboleHiveExecutor) Abort(ctx context.Context, tCtx core.TaskExecutionContext) error { diff --git a/go/tasks/plugins/presto/executor.go b/go/tasks/plugins/presto/executor.go index 64420d92e..b1b2325a7 100644 --- a/go/tasks/plugins/presto/executor.go +++ b/go/tasks/plugins/presto/executor.go @@ -63,7 +63,7 @@ func (p Executor) Handle(ctx context.Context, tCtx core.TaskExecutionContext) (c return core.UnknownTransition, err } - return core.DoTransition(phaseInfo), nil + return core.DoTransitionType(core.TransitionTypeBarrier, phaseInfo), nil } func (p Executor) Abort(ctx context.Context, tCtx core.TaskExecutionContext) error { diff --git a/tests/end_to_end.go b/tests/end_to_end.go index 341bbe1c6..ba35d2f06 100644 --- a/tests/end_to_end.go +++ b/tests/end_to_end.go @@ -254,7 +254,7 @@ func RunPluginEndToEndTest(t *testing.T, executor pluginCore.Plugin, template *i tCtx.OnMaxDatasetSizeBytes().Return(1000000) tCtx.OnSecretManager().Return(secretManager) - trns := pluginCore.DoTransition(pluginCore.PhaseInfoQueued(time.Now(), 0, "")) + trns := pluginCore.DoTransitionType(pluginCore.TransitionTypeBarrier, pluginCore.PhaseInfoQueued(time.Now(), 0, "")) for !trns.Info().Phase().IsTerminal() { trns, err = executor.Handle(ctx, tCtx) assert.NoError(t, err)