feat(services/s3): add conditional delete with if-match#7607
Open
YuangGao wants to merge 3 commits into
Open
Conversation
a6dd63c to
3af96e5
Compare
1 task
Member
Seems to be wrong. There is no DeleteObjects v2 and DeleteObjects did support setting etag. For example: POST /?delete HTTP/1.1
Host: Bucket.s3.amazonaws.com
x-amz-mfa: MFA
x-amz-request-payer: RequestPayer
x-amz-bypass-governance-retention: BypassGovernanceRetention
x-amz-expected-bucket-owner: ExpectedBucketOwner
x-amz-sdk-checksum-algorithm: ChecksumAlgorithm
<?xml version="1.0" encoding="UTF-8"?>
<Delete xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<Object>
<ETag>string</ETag>
<Key>string</Key>
<LastModifiedTime>timestamp</LastModifiedTime>
<Size>long</Size>
<VersionId>string</VersionId>
</Object>
...
<Quiet>boolean</Quiet>
</Delete>Please double check. |
Contributor
Author
|
yes, I confused it with
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Closes #7090.
Rationale for this change
AWS S3 supports
If-MatchonDeleteObjectsince 2024 (docs). Expose it through OpenDAL so callers can do CAS-style conditional deletesWhat changes are included in this PR?
Core:
Capability::delete_with_if_match.if_match: Option<String>toOpDelete,DeleteOptions, and aFutureDelete::if_matchbuilder.correctness_check.rsS3:
delete_with_if_match: trueon the S3 capability.s3_delete_objectinjectsIf-Matchwhenargs.if_match()is set.s3_delete_objectspropagates per-objectif_matchinto the<ETag>field of theDeleteObjectsXML body, so the batch path stays a single request even with conditional deletes.CI:
delete_with_if_match=falsetoOPENDAL_TEST_CAPABILITY_OVERRIDESin the fourminio_s3*action.yml filesTests:
test_delete_with_if_match_match/_mismatchincore/tests/behavior/async_delete.rs.Bindings:
DeleteOptionsextended withif_match; Pythonpyistubs and async/syncdelete()signatures updated. .NET / Java / Haskell / Ruby / OCaml use..Default::default()and need no changes.Are there any user-facing changes?
Yes, additive only —
op.delete_with(path).if_match(etag)is a new opt-in API. Existingop.delete(path)is unchanged.AI Usage Statement
AI-assisted implementation.