Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

Revert "deprecated TransitionTypeBarrier (#336)" #408

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion go/tasks/pluginmachinery/core/transition.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion go/tasks/pluginmachinery/internal/webapi/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
return core.UnknownTransition, err
}

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

Check warning on line 100 in go/tasks/pluginmachinery/internal/webapi/core.go

View check run for this annotation

Codecov / codecov/patch

go/tasks/pluginmachinery/internal/webapi/core.go#L100

Added line #L100 was not covered by tests
}

func (c CorePlugin) Abort(ctx context.Context, tCtx core.TaskExecutionContext) error {
Expand Down
2 changes: 1 addition & 1 deletion 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.DoTransition(phaseInfo), nil
return core.DoTransitionType(core.TransitionTypeBarrier, phaseInfo), nil
}

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

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

Check warning on line 68 in go/tasks/plugins/hive/executor.go

View check run for this annotation

Codecov / codecov/patch

go/tasks/plugins/hive/executor.go#L68

Added line #L68 was not covered by tests
}

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

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

Check warning on line 66 in go/tasks/plugins/presto/executor.go

View check run for this annotation

Codecov / codecov/patch

go/tasks/plugins/presto/executor.go#L66

Added line #L66 was not covered by tests
}

func (p Executor) Abort(ctx context.Context, tCtx core.TaskExecutionContext) error {
Expand Down
2 changes: 1 addition & 1 deletion tests/end_to_end.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading