Skip to content

Improve the handling of dirty paths and mutation locking in the server #2799

Description

@ljeub-pometry

Right now, reading a path cleans up any folders marked as dirty, this means that reads need to hold a read-lock on the mutations. Otherwise, a read might clean up an in-progress path used by a mutation. This makes it very easy to run into accidental dead locks, see #2787.

We should change this such that:

  • reads do not clean up dirty paths and treat any path marked as dirty the same way as a path that doesn't exist
  • mutations only hold an upgradeable read-lock initially while they resolve the path until they have written the dirty marker at which point they downgrade the lock to a normal read-lock. Only if part of the path for the mutation is marked dirty or the mutation needs to create a dirty marker in a folder that already contains a marker file, the lock is upgraded to a write lock. With the write lock any dirty path can be cleaned up as needed (no other mutation in progress).

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions