You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by "dgvj-work (via GitHub)" <gi...@apache.org> on 2026/08/24 17:31:54 UTC

Re: [PR] fix(services/gcs): honor if_not_exists on chunked writes [opendal]

dgvj-work commented on PR #8046:
URL: https://github.com/apache/opendal/pull/8046#issuecomment-5398936944

   You're right that returning `Unsupported` was too abrupt.
   
   I looked at whether the XML multipart path can honor the condition: GCS documents that preconditions cannot be used there (`400 NotImplemented`), and Complete Multipart Upload replaces any existing object with the same name. So XML multipart itself cannot do this.
   
   JSON resumable uploads can. `ifGenerationMatch=0` is valid on the initial POST and is ignored on later chunk PUTs, which is enough to make a chunked create-if-not-exists fail with `412` / `ConditionNotMatch`.
   
   This PR now:
   - keeps XML multipart for unconditional `write_can_multi`
   - sends `writer_with(...).if_not_exists(true)` through resumable upload
   - leaves single-shot `write_with(...).if_not_exists(true)` on the existing JSON insert path
   
   `test_writer_write_with_if_not_exists` no longer special-cases GCS.


-- 
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: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org