Could anybody explain for the uninitiated?
It ensures that when you try to upload (or “put”) a new version of a file, the operation only succeeds if the file on the server still has the exact version (ETag) you specify. If someone else has updated the file in the meantime, your upload is blocked to prevent overwriting their changes. This is especially useful in scenarios where multiple users or processes are working on the same data, as it helps maintain cons…
Amazon S3 Adds Put-If-Match (Compare-and-Swap)
111–120 of 166 posts
Re: Amazon S3 Adds Put-If-Match (Compare-and-Swap)
#112Earlier quoted context omitted.
Unfortunately, for a multi-part upload it isn't a hash of the total object, it is a hash of the hashes for each part, which is a lot less useful. Especially if you don't know how the file was partititioned during upload. And even if it was for the whole file, it isn't used for the ETag, so, so it can't be used for conditional PUTs. I had a use case where this looked really promising, then I ran into the multipart upl…
Don't the SDKs take care of computing the multi-part checksum during upload? > To create a trailing checksum when using an AWS SDK, populate the ChecksumAlgorithm parameter with your preferred algorithm. The SDK uses that algorithm to calculate the checksum for your object (or object parts) and automatically appends it to the end of your upload request. This behavior saves you time because Amazon S3 performs both the…
Re: Amazon S3 Adds Put-If-Match (Compare-and-Swap)
#113Earlier quoted context omitted.
this actually sounds interesting. do you precreate the workers beforehand and then just keep them in a stopped state?
yeah. one of the goals was startup time, so It made sense to precreate them. In practice we never ran out of free machines (and if we did, I have a cdk script to make more), and inifnite scaling is a pain in the butt anyways due to having to manage subnets etc. Cost-wise we're only paying for the EBS volumes for the stopped instances which are like 4GB each, so they cost practically nothing, we spend less than a doll…
Re: Amazon S3 Adds Put-If-Match (Compare-and-Swap)
#114Earlier quoted context omitted.
this actually sounds interesting. do you precreate the workers beforehand and then just keep them in a stopped state?
yeah. one of the goals was startup time, so It made sense to precreate them. In practice we never ran out of free machines (and if we did, I have a cdk script to make more), and inifnite scaling is a pain in the butt anyways due to having to manage subnets etc. Cost-wise we're only paying for the EBS volumes for the stopped instances which are like 4GB each, so they cost practically nothing, we spend less than a doll…
Re: Amazon S3 Adds Put-If-Match (Compare-and-Swap)
#115Ah so its not only me that uses AWS primitives for hackily implementing all sorts of synchronization primitives. My other favorite pattern is implementing a pool of workers by quering ec2 instances with a certain tag in a stopped state and starting them. Starting the instance can succeed only once - that means I managed to snatch the machine. If it fails, I try again, grabbing another one. This is one of those things…
Re: Amazon S3 Adds Put-If-Match (Compare-and-Swap)
#116Earlier quoted context omitted.
Unfortunately, for a multi-part upload it isn't a hash of the total object, it is a hash of the hashes for each part, which is a lot less useful. Especially if you don't know how the file was partititioned during upload. And even if it was for the whole file, it isn't used for the ETag, so, so it can't be used for conditional PUTs. I had a use case where this looked really promising, then I ran into the multipart upl…
Ways to control etag/Additional Checksums without configuring clients: CopyObject writes a single part object and can read from a multipart object, as long as the parts total less than the 5 gibibyte limit for a single part. For future writes, s3:ObjectCreated:CompleteMultipartUpload event can trigger CopyObject, else defrag to policy size parts. Boto copy() with multipart_chunksize configured is the most convenient…
Correction: and also part quantity (parsed from etag) for comparison
Re: Amazon S3 Adds Put-If-Match (Compare-and-Swap)
#117Earlier quoted context omitted.
Someone made an informed technical bet that worked out. Sounds like HN material to me. (Also, is it really a useful ad if you can't easily use the product?)
Worked out how? There’s no implementation. It’s just conjecture.
> Our bet that S3 would get it in a reasonable time-frame worked out!
Re: Amazon S3 Adds Put-If-Match (Compare-and-Swap)
#118Earlier quoted context omitted.
Don't the SDKs take care of computing the multi-part checksum during upload? > To create a trailing checksum when using an AWS SDK, populate the ChecksumAlgorithm parameter with your preferred algorithm. The SDK uses that algorithm to calculate the checksum for your object (or object parts) and automatically appends it to the end of your upload request. This behavior saves you time because Amazon S3 performs both the…
It does and has a good default. An issue I've come across though is you have the file locally and you want to check the e-tag value - you'll have to do this locally first and then compare the value to the S3 stored object.
It would be nice if this got updated for Additional Checksums.
Re: Amazon S3 Adds Put-If-Match (Compare-and-Swap)
#119Re: Amazon S3 Adds Put-If-Match (Compare-and-Swap)
#120Earlier quoted context omitted.
yeah. one of the goals was startup time, so It made sense to precreate them. In practice we never ran out of free machines (and if we did, I have a cdk script to make more), and inifnite scaling is a pain in the butt anyways due to having to manage subnets etc. Cost-wise we're only paying for the EBS volumes for the stopped instances which are like 4GB each, so they cost practically nothing, we spend less than a doll…
I always thought that stopped instances will cost money as well?!