Repository navigation
fix(s3): a lost O_EXCL create drops its copy, so reads find the object that won - #156
Merged
Merged
Conversation
…t that won When an exclusive create's conditional PUT finds the object another instance created first, the flush still fails with EEXIST, and now also removes the local copy and its entry. Before, the loser kept serving its own bytes (a copy with no synced snapshot is never revalidated), and a later write kept the stale exclusive flag and lost again. Fixes #155 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #155.
When an
O_EXCLcreate'sIf-None-Match: *upload finds that another instance created the object first,put()still fails the flush withEEXIST. It now also removes the local copy and itsentriesentry first.Before this change, on the losing instance:
exclusive: true, so a later write failed withEEXISTagain instead of overwriting the object (If-Match).Now the next lookup asks S3 and finds the object that won. A later write is an ordinary overwrite of it.
Test:
tests/s3.test.ts, "an O_EXCL create that lost drops its copy". It failed before the fix (minevstheirs) and passes after. The vfs unit suite passes: 271 tests.Found while reviewing oidc.to's use of
writeFile(..., { flag: "wx" })for single-use claims on an s3 volume.🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need.