I've noticed that the copyObject
operation in the Node.JS AWS SDK occasionally throws a NoSuchKey
exception when I attempt to copy a file immediately after it's been created.
To try and counteract this, I've added a call to getObject
- only attempting to copy if the file is actually returned by getObject
. However this still occasionally results in NoSuchKey
being thrown.
Is CopyObject
exempt from the strong consistency model in S3?
CodePudding user response:
Based on https://aws.amazon.com/blogs/aws/amazon-s3-update-strong-read-after-write-consistency/, it really seems that list of actions supporting strong consistency is GET
, PUT
and LIST
, while COPY
not being listed.
That being said, I assume you could tweak your process to GET
the newly created object, which is strongly consistent operation, and then PUT
it to the new destination, thus not using the COPY
operation.