I upload a file from an Android device to an S3 bucket through this code
TransferUtility trasnferManager = new TransferUtility(s3, context); trasnferManager.upload(..,..,..);
After that, I have a lambda trigger associated with the S3: ObjectCreated event.
When lambda is running, I try to get the file through the S3.getObject () function. Unfortunately, sometimes I get " NoSuchKey: the specified key does not exist: ". After that, lambda repeats a couple of times and successfully receives the file and continues to execute it.
In my opinion, is the lambda function executed before the file is available in S3? But this should not happen by design. The trigger should start after the file upload to S3 is complete.
According to the announcement on August 4, 2015 :
Amazon S3 buckets in all regions provide read-after-write sequencing for EMPTY new objects and possible consistency for overwriting EMPs and DELETES.
Consolidation after reading allows you to retrieve objects immediately after creation in Amazon S3.
But before that:
All regions except the US Standard (renamed US East (N. Virginia) ) support read-after-write consistency for new objects uploaded to Amazon S3.
My bucket is in the U.S. region (N. Virginia) , and it is created until August 4, 2015 . I do not know that this could be a problem ...
EDIT: 10/20/2016
According to documentaion , an EVENTUALLY CONSISTENT READ operation can return NO RESULTS even if two or more WRITE operations were completed before.
In this example, both W1 (record 1) and W2 (record 2) end before the start of R1 (read 1) and R2 (see 2). For sequential reading, R1 and R2 return color = ruby. Ultimately, read, R1 and R2 can return color = red, color = ruby ββor without results, depending on the amount of time that has elapsed.
