Skip to content

Conversation

@secfree
Copy link
Contributor

@secfree secfree commented May 19, 2025

Implement objstore.ObjectSizer interface on UploadReader to support optimized multipart uploads. This allows objstore.TryToGetSize to determine the total size of the upload stream, enabling proper buffer pre-allocation and improving upload performance.

The implementation tracks the running total of bytes read in the size field and returns it via ObjectSize(), resolving the below warning when using a S3 storage for debuginfo.

level=warn ... msg="could not guess file size for multipart upload; upload might be not optimized" name=debuginfo/8201aa879bcc815d4abc232049bb1c2a/debuginfo err="unsupported type of io.Reader: *debuginfo.UploadReader"

Implement objstore.ObjectSizer interface on UploadReader to support optimized
multipart uploads. This allows objstore.TryToGetSize to determine the total
size of the upload stream, enabling proper buffer pre-allocation and improving
upload performance.

The implementation tracks the running total of bytes read in the size field
and returns it via ObjectSize(), resolving the warning:
"could not guess file size for multipart upload; upload might be not optimized"
@secfree secfree requested a review from a team as a code owner May 19, 2025 07:48
@brancz brancz merged commit 3426b6b into parca-dev:main May 21, 2025
34 checks passed
@brancz
Copy link
Member

brancz commented May 21, 2025

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants