Skip to content

Refactor file locking to use atomic rename pattern to fix NFS stalls - #131

Open
aviezerl wants to merge 3 commits into
devfrom
fix@nfs-stalls-atomic-rename
Open

Refactor file locking to use atomic rename pattern to fix NFS stalls#131
aviezerl wants to merge 3 commits into
devfrom
fix@nfs-stalls-atomic-rename

Conversation

@aviezerl

Copy link
Copy Markdown
Collaborator

The current locking architecture uses fcntl read-locks ("r") or exclusive read-locks ("r+") on metadata files (.naryn, .attrs). On NFS, this causes severe performance degradation and serialization of worker processes during high-concurrency read operations.

This commit refactors the persistence layer to use an Atomic Rename / Snapshot pattern, eliminating the need for read locks entirely.

The current locking architecture uses fcntl read-locks ("r") or exclusive
read-locks ("r+") on metadata files (.naryn, .attrs). On NFS, this causes
severe performance degradation and serialization of worker processes during
high-concurrency read operations.

This commit refactors the persistence layer to use an Atomic Rename / Snapshot
pattern, eliminating the need for read locks entirely.
@aviezerl
aviezerl requested a review from ramijaschek December 24, 2025 11:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants