cloudflare / cloudflare/cloudflare-docs
R2: clarify atomicity of If-None-Match:* PutObject and negative-read finality
- Dominant language
- MDX
- Stars
- 5.2k
- Forks
- 16.7k
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 337
Description
### Existing documentation URL(s)
https://developers.cloudflare.com/r2/api/s3/api
https://developers.cloudflare.com/r2/reference/consistency/
### What changes are you suggesting?
We are evaluating Cloudflare R2's S3-compatible API for a create-once control record and found two storage semantics that do not appear to be explicitly documented.
1. Concurrent conditional PutObject
For a previously absent key, if two or more clients concurrently issue PutObject with If-None-Match: *, is the precondition evaluated atomically against committed bucket state such that at most one request can return HTTP success?
Specifically, can two concurrent If-None-Match: * PutObject requests to the same previously absent key ever both return a 2xx success?
If this guarantee exists, please clarify it in the R2 documentation, including the expected result for competing requests.
2. Negative read following an ambiguous PutObject
Suppose a client sends a PutObject request and loses its connection before receiving the response, so the client cannot determine whether the write committed.
If a subsequent strongly consistent HeadObject or GetObject returns NoSuchKey, is that absence final with respect to the earlier request?
In other words, can the earlier in-flight request still subsequently commit after the negative read has returned?
If R2 defines this ordering/finality guarantee, please document it explicitly.
These clarifications would help users who rely on conditional object creation for create-once records, distributed coordination, and fail-closed control mechanisms.
This question concerns the current R2 S3-compatible API only and requires no account-specific information.
### Additional information
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.