Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: S3 User Metadata not set for multi part uploads #5429

Closed
1 task done
catcatmu opened this issue Dec 18, 2024 · 0 comments · Fixed by #5430
Closed
1 task done

bug: S3 User Metadata not set for multi part uploads #5429

catcatmu opened this issue Dec 18, 2024 · 0 comments · Fixed by #5430
Labels
bug Something isn't working

Comments

@catcatmu
Copy link
Contributor

catcatmu commented Dec 18, 2024

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:
   let w = operator
            .writer_with("/test")
            .user_metadata(metadata)
            .await;
  1. Write out a large file, calling write several times, in the test a 1Gb file was used
  2. Open S3, the metadata will be missing

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:

       // 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?

  • Yes, I would like to submit a PR.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant