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

[tests-only] fix high s3ng memory usage #3373

Merged
merged 1 commit into from
Oct 19, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions pkg/storage/fs/s3ng/blobstore/blobstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,6 @@ func (p *PrometheusAwareReadSeekCloser) Close() error {

// Upload stores some data in the blobstore under the given key
func (bs *Blobstore) Upload(node *node.Node, reader io.Reader) error {
reader = &PrometheusAwareReader{
r: reader,
m: metrics.Tx,
}
size := int64(-1)
if file, ok := reader.(*os.File); ok {
info, err := file.Stat()
Expand All @@ -118,6 +114,11 @@ func (bs *Blobstore) Upload(node *node.Node, reader io.Reader) error {
size = info.Size()
}

reader = &PrometheusAwareReader{
r: reader,
m: metrics.Tx,
}

_, err := bs.client.PutObject(context.Background(), bs.bucket, bs.path(node), reader, size, minio.PutObjectOptions{ContentType: "application/octet-stream"})

if err != nil {
Expand Down