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

Feat s3 transfer manager v2 PutObject #2733

Open
wants to merge 9 commits into
base: feat-transfer-manager-v2
Choose a base branch
from

Conversation

wty-Bryant
Copy link
Contributor

Implement v2 s3 transfer manager's putobject api bound to single union client which mimics normal service client's initialization and api call

@wty-Bryant wty-Bryant requested a review from a team as a code owner August 4, 2024 21:05
@lucix-aws
Copy link
Contributor

lucix-aws commented Aug 5, 2024

Tests are failing.

I know that some of the business logic is duplicated from the original version here, but I'm reviewing it as if it's all new.

.changelog/f48bec23878347028d9d4b5ef03e0757.json Outdated Show resolved Hide resolved
feature/s3/transfermanager/api.go Outdated Show resolved Hide resolved
feature/s3/transfermanager/internal/testing/endpoints.go Outdated Show resolved Hide resolved
feature/s3/transfermanager/pool.go Outdated Show resolved Hide resolved
feature/s3/transfermanager/putobject.go Outdated Show resolved Hide resolved
Close()
}

type maxSlicePool struct {
Copy link
Contributor

Choose a reason for hiding this comment

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

See my comment elsewhere about non-necessity of shared pool. I think we can greatly simplify this by just having one fixed pool per upload call.

Copy link
Contributor

Choose a reason for hiding this comment

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

You removed the shared-ness of the pool but you didn't really simplify anything:

  1. The pool sized is now fixed, since it's not shared, it never has to grow or shrink. The entire ModifyCapacity API and business logic to support it should not longer be necessary.
  2. None of the read/write locking here should be necessary. Buffered channels inherently give us synchronization across goroutines, this should be as simple as Get() and Put() calls that pull and push to such a channel.

Frankly I would recommend you start from scratch here. A buffered-channel-based fixed size pool should be trivial to implement in significantly less code vs. inheriting/bastardizing the old version of this.

feature/s3/transfermanager/putobject.go Outdated Show resolved Hide resolved
feature/s3/transfermanager/putobject.go Outdated Show resolved Hide resolved
feature/s3/transfermanager/putobject.go Outdated Show resolved Hide resolved
feature/s3/transfermanager/pool.go Show resolved Hide resolved
feature/s3/transfermanager/transfermanager.go Outdated Show resolved Hide resolved
feature/s3/transfermanager/putobject.go Outdated Show resolved Hide resolved
feature/s3/transfermanager/putobject.go Outdated Show resolved Hide resolved
feature/s3/transfermanager/api_client.go Outdated Show resolved Hide resolved
feature/s3/transfermanager/api_client.go Outdated Show resolved Hide resolved
feature/s3/transfermanager/api_client.go Outdated Show resolved Hide resolved
feature/s3/transfermanager/api_op_PutObject.go Outdated Show resolved Hide resolved
feature/s3/transfermanager/api_op_PutObject.go Outdated Show resolved Hide resolved
feature/s3/transfermanager/api_op_PutObject.go Outdated Show resolved Hide resolved
}

// This upload exceeded maximum number of supported parts, error now.
if part > DefaultMaxUploadParts {
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be MaxUploadParts then instead of just DefaultMax.... But same question as previous, why do we want to limit the number of parts used?

Copy link
Contributor

Choose a reason for hiding this comment

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

It appears there is in fact a 10k part limit for MPUs, I didn't catch this at first.

We're going to need to discuss offline how we want to handle this. The error case we're hitting here is unacceptable (failing a 10,000 part MPU only after we realize there are 10k parts).

feature/s3/transfermanager/api_op_PutObject.go Outdated Show resolved Hide resolved
Copy link
Contributor

@lucix-aws lucix-aws left a comment

Choose a reason for hiding this comment

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

We need to seriously re-examine the part pool behavior. It seems entirely overcomplicated for what we need out of it.

We need to discuss how we manage maximum part size of 10k for MPUs - failing on an in-progress download from exceeding the limit after the fact isn't acceptable behavior.

feature/s3/transfermanager/api.go Outdated Show resolved Hide resolved
feature/s3/transfermanager/api.go Outdated Show resolved Hide resolved
feature/s3/transfermanager/api_op_PutObject.go Outdated Show resolved Hide resolved
feature/s3/transfermanager/api_op_PutObject.go Outdated Show resolved Hide resolved
feature/s3/transfermanager/api_op_PutObject.go Outdated Show resolved Hide resolved
Close()
}

type maxSlicePool struct {
Copy link
Contributor

Choose a reason for hiding this comment

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

You removed the shared-ness of the pool but you didn't really simplify anything:

  1. The pool sized is now fixed, since it's not shared, it never has to grow or shrink. The entire ModifyCapacity API and business logic to support it should not longer be necessary.
  2. None of the read/write locking here should be necessary. Buffered channels inherently give us synchronization across goroutines, this should be as simple as Get() and Put() calls that pull and push to such a channel.

Frankly I would recommend you start from scratch here. A buffered-channel-based fixed size pool should be trivial to implement in significantly less code vs. inheriting/bastardizing the old version of this.

feature/s3/transfermanager/types.go Outdated Show resolved Hide resolved
feature/s3/transfermanager/types.go Outdated Show resolved Hide resolved
feature/s3/transfermanager/api_op_PutObject.go Outdated Show resolved Hide resolved
}

// This upload exceeded maximum number of supported parts, error now.
if part > DefaultMaxUploadParts {
Copy link
Contributor

Choose a reason for hiding this comment

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

It appears there is in fact a 10k part limit for MPUs, I didn't catch this at first.

We're going to need to discuss offline how we want to handle this. The error case we're hitting here is unacceptable (failing a 10,000 part MPU only after we realize there are 10k parts).

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.

3 participants