Thanks to visit codestin.com
Credit goes to github.com

Skip to content

bug: updates to one column can clobber updates to other columns #9822

@spikecurtis

Description

@spikecurtis

We have a single method to update workspace builds that covers multiple fields. Typical use in our codebase is, in a transaction

  1. Read the workspace build
  2. Update the workspace build, using the values from 1 for any field we are not changing.

At the default transaction isolation, this is not safe. If another database user commits changes to the same build between 1 and 2, the transaction completes successfully and we clobber those changes.

Solution Notes

In addition to fixing our updates to be safe for concurrent use, we should consider splitting the provisioner_state column into pre-build state and post-build state. With state overwriting state, it can be hard to diagnose why a build acted the way it did. This wouldn't have saved us in this case, but would have made diagnosis easier.

cc @mafredri @johnstcn @matifali @bpmct

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug riskProne to bugss3Bugs that confuse, annoy, or are purely cosmeticstaleThis issue is like stale bread.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions