Skip to content

Add local POSIX filesystem backend#30

Merged
FiloSottile merged 10 commits intomainfrom
filippo/local
Apr 25, 2025
Merged

Add local POSIX filesystem backend#30
FiloSottile merged 10 commits intomainfrom
filippo/local

Conversation

@FiloSottile
Copy link
Copy Markdown
Owner

No description provided.

This avoids replicating the logic in each Backend implementation, and
also frees it from keeping track of what files are compressed (so they
can be decompressed by Fetch), which could be difficult for future
backends with less access to metadata, like the POSIX filesystem one.
@AGWA
Copy link
Copy Markdown
Contributor

AGWA commented Apr 22, 2025

durable.WriteFile isn't atomic - there's an instant between OpenFile and Write when the file will be empty, which seems problematic for writing the checkpoint. I would implement it like:

  1. Open directory
  2. Open temporary file in directory
  3. Write to temporary file
  4. Fsync and close temporary file
  5. Rename temporary file
  6. Fsync and close directory

@FiloSottile
Copy link
Copy Markdown
Owner Author

@AGWA good catch, done!

@FiloSottile FiloSottile merged commit d3ddb50 into main Apr 25, 2025
2 checks passed
@FiloSottile FiloSottile deleted the filippo/local branch April 25, 2025 22:54
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