Skip to content

Make worker / actor assignment atomic #1639

Closed

Description

Worker and actor assignment is bi-directional. They each have an assignment field pointing to the other object. The update operations only mutate a single object (actor or worker) at a time, which results in race conditions and leaking one side of the assignment.

We should investigate whether it makes sense to update both sides of the assignment in a single transaction to make this operation atomic. Will this simplify some of the edge cases and special handling we have to prevent race conditions?

Activity

  1. BenTheElder commented on Sep 14, 2026

    @BenTheElder
    Collaborator

    cc Tim Hockin (@thockin) Julian Gutierrez Oschmann (@juli4n) Eitan Yarmush (@EItanya) Jet Chiang (@supreme-gg-gg)

    There's been some debate about how much we want to use postgres / SQL vs treating the database as sort of "key/value" that can be swapped out.

    I think we should lean into postgres and push a little bit more down into the transactions, FWIW.

  2. added a commit that references this issue on Oct 31, 2026
    74c6ab3
  3. added a commit that references this issue on Nov 2, 2026
    73c31ef
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/api-machineryarea/reliabilitykind/designDesign discussion, investigation, or research required before implementationprio/P0Highest priority / required for next milestone

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions