Skip to content

Commit

Permalink
Raise create work flow isolation back to Serializable
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Li <[email protected]>
  • Loading branch information
ryli17 committed Oct 23, 2020
1 parent 3b230d5 commit 084b6cc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion db/workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ var (

// CreateWorkflow creates a new workflow
func (d TinkDB) CreateWorkflow(ctx context.Context, wf Workflow, data string, id uuid.UUID) error {
tx, err := d.instance.BeginTx(ctx, &sql.TxOptions{Isolation: sql.LevelRepeatableRead})
tx, err := d.instance.BeginTx(ctx, &sql.TxOptions{Isolation: sql.LevelSerializable})
if err != nil {
return errors.Wrap(err, "BEGIN transaction")
}
Expand Down
2 changes: 2 additions & 0 deletions deploy/db/tinkerbell-init.sql
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ CREATE TABLE IF NOT EXISTS workflow_worker_map (
, worker_id UUID NOT NULL
);

CREATE UNIQUE INDEX IF NOT EXISTS uidx_workflow_worker_map ON workflow_worker_map (workflow_id, worker_id);

CREATE TABLE IF NOT EXISTS workflow_data (
workflow_id UUID NOT NULL
, version INT
Expand Down

0 comments on commit 084b6cc

Please sign in to comment.