adriancaruana opened a new pull request, #852:
URL: https://github.com/apache/arrow-rs-object-store/pull/852

   # Which issue does this PR close?
   
   Closes #<issue>.
   
   # Rationale for this change
   
   The `If-Match` branch of `AmazonS3::put_opts` already sets 
`.retry_on_conflict(true)`. The `If-None-Match` branch does not, although AWS 
documents a 409 for it too: a conditional write returns `409 Conflict` when a 
concurrent delete to the key succeeds before the write completes, and the docs 
state that "uploads may be retried after receiving a `409 Conflict` error". 
Concurrent conditional creates on the same key return 412, which this branch 
already maps to `AlreadyExists`.
   
   Without the retry, that 409 reaches the caller as `Error::AlreadyExists`, 
via the `CONFLICT` mapping in `client/retry.rs`. That is the same error the 
Create branch deliberately returns for the settled 412/304 case, so a caller 
cannot distinguish "the object exists" from "a competing create was in flight 
and nothing landed". Callers using `PutMode::Create` as a mutual-exclusion 
primitive are all told a holder exists when no create landed, so nothing claims 
the work.
   
   # What changes are included in this PR?
   
   One line: `.retry_on_conflict(true)` on the `(PutMode::Create, 
S3ConditionalPut::ETagMatch)` branch in `src/aws/mod.rs`, with a comment 
matching the sibling branch.
   
   # Are there any user-facing changes?
   
   No API change. A conditional create that previously failed with 
`AlreadyExists` on a transient conflict is now retried under the existing retry 
policy.
   
   # Testing
   
   No unit test added. The sibling `If-Match` retry has none either, and the 
409 path is only exercised by the credentials-gated `test_conditional_put`. I 
did not want to add mock-server infrastructure for a one-line change, but happy 
to if you would prefer it.
   
   Verified with `cargo check`, `clippy` and `fmt --check` under 
`--no-default-features --features aws-base`. I could not build `--all-features` 
locally (`ring`/`aws-lc-rs` need a C compiler I do not have on this machine).
   
   I have not reproduced the 409 against real S3. The behaviour is from AWS 
documentation and from the sibling branch's comment, not from an observed 
failure.
   
   # AI disclosure
   
   Written with AI assistance (Claude).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to