Skip to content

feat(services/s3): add append support#5428

Merged
Xuanwo merged 4 commits intoapache:mainfrom
Frank-III:s3-append
Feb 25, 2025
Merged

feat(services/s3): add append support#5428
Xuanwo merged 4 commits intoapache:mainfrom
Frank-III:s3-append

Conversation

@Frank-III
Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Close: #5351

Are there any user-facing changes?

when writing to S3 Express One Zone, user can:

let writer = op.writer_with(path).append(true).await?;
writer.write(bs).await?;
writer.close().await?;

@Frank-III Frank-III requested a review from Xuanwo as a code owner December 18, 2024 22:57
@github-actions github-actions bot added the releases-note/feat The PR implements a new feature or has a title that begins with "feat" label Dec 18, 2024
req = req.header(format!("{X_AMZ_META_PREFIX}{key}"), value)
}
}
req = self.insert_metadata_headers(req, Some(size), args);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, I assume that only the first append call supports setting up metadata. We don't need to repeat the metadata for subsequent append requests.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, so sorry for the late reply! having two crazy weeks after the holidays :(

I may not follow what you mean but it seems we could set up the metadata after the first one?
image

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi! can I get some feedback here, really want to finish it!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you're right. However, Maybe we don't need a new method s3_append_object_request. We can reuse the existing s3_put_object_request method. the only difference is that append requires a non-zero size.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the suggestion, but since I extract the meta data function out, I think keeping them separate is better for readability

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I may not follow what you mean but it seems we could set up the metadata after the first one?

Hi, from my current understanding, only the first append request can set metadata such as content-type and x-amz-meta-abc. Any metadata-related parameters in subsequent append requests will be ignored. That means that we can avoid sending those params in the subsequent append requests to save some extra bytes on the wire.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see!

@Frank-III Frank-III marked this pull request as draft December 24, 2024 00:06
@Frank-III Frank-III marked this pull request as ready for review January 22, 2025 02:39
Copy link
Copy Markdown
Member

@Xuanwo Xuanwo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @Frank-III for working on this!

@Xuanwo Xuanwo merged commit 9d34d1e into apache:main Feb 25, 2025
242 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

releases-note/feat The PR implements a new feature or has a title that begins with "feat"

Projects

None yet

Development

Successfully merging this pull request may close these issues.

new feature: Implement append object for S3

3 participants