Closed benesch closed 2 weeks ago
@tustvold are you the right person to review this? I saw you implemented quite a bit of the previous conditional put/get support.
To maintain strict backwards compatibility (e.g. with older versions of LocalStack), the new behavior is not on by default. It must be explicitly requested by the end user.
This isn't ideal, but it seemed best for the short term to avoid breaking backcompat for anyone who might be using a version of S3 that doesn't support CAS. In the long term, I think the ideal would definitely be to have the native S3 CAS support enabled by default (i.e. unless overridden explicitly by the user).
@tustvold if you can give me another re-run here I think we’ll be all green on CI. I fixed a minor clippy failure and upgraded to a version of localstack that supports conditional put.
Whew, all tests here are green! @tustvold let me know if there's anything else here you'd like to see, but from my perspective this is ready to (squash) merge.
Amazing. Any idea when this might go out 🔥
https://github.com/apache/arrow-rs/issues/6596 tracks the next release
Thanks very much for the review and merge, @tustvold!
Add support for
PutMode::Create
andcopy_if_not_exists
on native AWS S3, which uses the underlying conditional write primitive that Amazon launched earlier this year 0.The conditional write primitive is simpler than what's available in other S3-like products (e.g., R2), so new modes for
s3_copy_if_not_exists
ands3_conditional_put
are added to select the native S3-specific behavior.To maintain strict backwards compatibility (e.g. with older versions of LocalStack), the new behavior is not on by default. It must be explicitly requested by the end user.
The implementation for
PutMode::Create
is straightforward. The implementation ofcopy_if_not_exists
is a bit more involved, as it requires managing a multipart upload that uses the UploadPartCopy operation, which was not previously supported by this crate's S3 client.To ensure test coverage, the object store workflow now runs the AWS integration tests with conditional put both disabled and enabled.
Which issue does this PR close?
Fix #6285.