Skip to content

Conditional writes are not atomic; If-Match * is broken - #8

Merged
jaredLunde merged 2 commits into
beyondoss:mainfrom
paulocsanz:dst/conditional-writes
Aug 14, 2026
Merged

Conditional writes are not atomic; If-Match * is broken#8
jaredLunde merged 2 commits into
beyondoss:mainfrom
paulocsanz:dst/conditional-writes

Conversation

@paulocsanz

Copy link
Copy Markdown
Contributor

If-None-Match and If-Match were check-then-rename. Concurrent creates/updates both returned Ok. S3 If-Match * was stored as the literal etag and always 412. Two commits: tests that fail on main, then the fix.

  • Flock + re-check under the lock (path.lock, not with_extension).
  • If-Match * means the object exists (any etag).
  • copy_object fsyncs before rename.

git checkout HEAD~1 && cargo test -p beyond-objects-storage --test conditional_writes fails; HEAD passes.

Create-only must have one winner, If-Match is CAS, If-Match * updates an existing object. These fail on current main.
Flock + dest.recheck under the lock (append .lock, do not replace the extension). Treat If-Match * as exists-any-etag. fsync copy_object before rename.
@jaredLunde
jaredLunde merged commit c713927 into beyondoss:main Aug 14, 2026
5 checks passed
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