Skip to content

Fix S3 conditional writes - #2754

Merged
vieiralucas merged 3 commits into
faiscadev:mainfrom
freakinhippie:issue/2741
Oct 29, 2026
Merged

vieiralucas merged 3 commits into
faiscadev:mainfrom
freakinhippie:issue/2741

Conversation

@freakinhippie

Copy link
Copy Markdown
Contributor

Fixes #2741

Conditional S3 writes treated a current delete marker as a live object, preventing keys from being recreated after deletion in versioned buckets.

  • Allow PutObject and CompleteMultipartUpload with If-None-Match: * when the current version is a delete marker.
  • Return NoSuchKey for PutObject with If-Match when the current version is a delete marker.
  • Apply these checks during initial validation and revalidation under the write lock.
    Adds unit coverage for conditional creation of a missing key, recreation after a versioned delete, and If-Match against a delete marker.

@freakinhippie

freakinhippie commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor Author

This PR accidentally pulled in the prior PR. If that is a problem, please close the PR and I can resubmit. Fixed.

…ers as missing

- CompleteMultipartUpload now enforces If-Match (NoSuchKey on a missing
  key, 412 on an ETag mismatch) alongside If-None-Match, at the initial
  check and again under the write lock.
- A re-completion of an already-completed upload no longer returns a
  current delete marker as the completed object.
- DeleteObject If-Match returns NoSuchKey when the current version is a
  delete marker.
- Unit coverage plus an aws-sdk-rust E2E for the versioned-bucket
  delete-then-recreate flow.
@vieiralucas
vieiralucas merged commit a7f9657 into faiscadev:main Oct 29, 2026
157 checks passed
@vieiralucas

Copy link
Copy Markdown
Member

Thanks a lot for this, @freakinhippie. Conditional writes are exactly the kind of thing people lean on fakecloud to get right, and this closes a real gap from #2741. I pushed a few follow-ups before merging: CompleteMultipartUpload now honors If-Match as well as If-None-Match (missing key -> NoSuchKey, mismatch -> 412), the conditions are re-checked under the write lock so a concurrent write can't slip between check and commit, and delete markers now count as a missing key for both the multipart conditions and DeleteObject If-Match. Added unit tests for each path plus an E2E test covering conditional writes after a versioned delete. Merged. Really appreciate the contribution.

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.

S3 account boundaries and object locking

2 participants