catcatmu opened a new issue, #5429:
URL: https://github.com/apache/opendal/issues/5429
### Describe the bug
S3 File uploads which call s3_initiate_multipart_upload() does not set
user_meta.
### Steps to Reproduce
1. Create a new S3 Operator opendal::services::S3::default()
2. Create a new writer:
```rust
let w = operator
.writer_with("/test")
.user_metadata(metadata)
.await;
```
3. Write out a large file, calling write several times, in the test a 1Gb
file was used
4. Open S3, the metadata will be missing
**Temporary workaround but uses more memory:**
If the chunk_size is increased to greater than the file size, the metadata
is set.
### Expected Behavior
The user metadata is set when a multi-part uploaded object is written
### Additional Context
Adding the following to s3_initiate_multipart_upload, seems to solve the
issue:
```rust
// Set user metadata headers.
if let Some(user_metadata) = args.user_metadata() {
for (key, value) in user_metadata {
req = req.header(format!("{X_AMZ_META_PREFIX}{key}"), value)
}
}
```
### Are you willing to submit a PR to fix this bug?
- [X] Yes, I would like to submit 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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]