Reputation: 93
The caveat in Amazon S3 S3's PUT for new objects is that if you make a HEAD or GET request to a key name before the object is created, then create the object shortly after that, a subsequent GET might not return the object due to eventual consistency.
Why's this? What issue is the first GET creating? Is it because S3 might look for the object in other AZs and in the meanwhile, there is a PUT made for the same? Is S3 returning the previous status(checked across AZs and not found)
Upvotes: 0
Views: 84
Reputation: 78703
I'm not aware of any public documentation that explains the reason for this caveat.
A quick reminder of what the statement is on S3 consistency:
Amazon S3 provides read-after-write consistency for PUTS of new objects in your S3 bucket in all Regions with one caveat. The caveat is that if you make a HEAD or GET request to a key name before the object is created, then create the object shortly after that, a subsequent GET might not return the object due to eventual consistency.
Here are some related, non-authoritative discussions:
The first of those two discussions speculates that the reason is that S3 may cache the 404 object not found response to the initial HEAD/GET request and consequently may return that cached result on the GET following an initial PUT until the PUT has fully propagated. But that's speculative.
Upvotes: 1