You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by "Xuanwo (via GitHub)" <gi...@apache.org> on 2026/08/09 05:28:27 UTC
[I] services/gcs: XML multipart writer cannot honor write_with_if_not_exists [opendal]
Xuanwo opened a new issue, #8040:
URL: https://github.com/apache/opendal/issues/8040
## Summary
GCS supports `write_with_if_not_exists` for single-shot uploads via `ifGenerationMatch=0`, but OpenDAL's multipart writer path uses the XML API multipart upload APIs, which do not support request preconditions.
This was exposed by `test_writer_write_with_if_not_exists` after #8028 added chunked-writer precondition coverage. Against GCS the multipart write with `if_not_exists(true)` succeeds and overwrites an existing object instead of returning `ConditionNotMatch`.
## Evidence from GCS docs
From [Request preconditions](https://docs.cloud.google.com/storage/docs/request-preconditions):
> Preconditions cannot be used in XML API multipart uploads. Attempting to do so results in a `400 NotImplemented` error.
`If-None-Match` is also not a substitute here: GCS documents it for retrieve/GET/HEAD style requests, and the Complete Multipart Upload request headers do not list precondition headers.
## Current OpenDAL behavior
- Single-shot `write_with(...).if_not_exists(true)` works on GCS.
- Capability currently reports `write_with_if_not_exists: true` and `write_can_multi: true`.
- Chunked `writer_with(...).if_not_exists(true)` therefore looks supported, but the multipart path cannot enforce the condition.
## Possible directions
1. Keep skipping `test_writer_write_with_if_not_exists` on GCS until there is a supported upload path.
2. Move GCS multi-write onto an API that can enforce `ifGenerationMatch=0` (for example resumable upload), if that can preserve current writer semantics.
3. Narrow the advertised capability so multipart conditional writes are not implied when only single-shot conditional writes are possible.
## References
- Failing main Behavior Test: https://github.com/apache/opendal/actions/runs/31186355721
- Related conditional-write tracking: #7889
- Azblob multipart precondition fix that introduced the coverage: #8028
--
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.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] services/gcs: XML multipart writer cannot honor write_with_if_not_exists [opendal]
Posted by "dgvj-work (via GitHub)" <gi...@apache.org>.
dgvj-work commented on issue #8040:
URL: https://github.com/apache/opendal/issues/8040#issuecomment-5247849851
I'd like to take this. I'll look at how we can honor `write_with_if_not_exists` on the GCS multipart path (given XML multipart preconditions aren't supported) and open a PR.
--
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