Skip to content

AWS max retries option added#5354

Merged
rafael merged 1 commit intovitessio:masterfrom
RicardoLorenzo:aws_backup_retries
Nov 9, 2019
Merged

AWS max retries option added#5354
rafael merged 1 commit intovitessio:masterfrom
RicardoLorenzo:aws_backup_retries

Conversation

@RicardoLorenzo
Copy link
Copy Markdown

Adding an option for defining the maximum number of AWS request retries and defaulting to 3 as per AWS documentation.

@deepthi
Copy link
Copy Markdown
Collaborator

deepthi commented Oct 25, 2019

Have you already tested this? There are no integration tests against s3.

@rafael
Copy link
Copy Markdown
Member

rafael commented Oct 29, 2019

From my perspective, this looks good. Given that this is setting the default value to the same value that the golang driver already uses: https://sourcegraph.com/github.com/aws/aws-sdk-go@39208f40a1ca0c02a3b7a950fcc78db3ea50cf25/-/blob/aws/client/default_retryer.go#L40

Effectively, this PR is a noop that exposes a way to tune this value from vitess.

@deepthi I think this a bit tricky to test as the failures we see here are transient. Also, we will be testing that S3 driver is doing what it advertises, so I don't think adding a test here is required.

What kind of test you had in mind?

@deepthi
Copy link
Copy Markdown
Collaborator

deepthi commented Oct 30, 2019

I see the point about it being hard to test. But if it is supposed to default to 3 retries, why wasn't it being retried? (I looked at the code you linked to and agree with your analysis that it is supposed to default to 3)

@rafael
Copy link
Copy Markdown
Member

rafael commented Oct 30, 2019

@deepthi I believe they are being retried. My thinking is that they are still failing after three attempts.

I think more than the trickiness, what I wanted to convey is that this change only adds more flexibility when configuring the driver. I'm thinking that adding a test for this is to test that the external dependency is respecting the contract. That seems like an anti-pattern.

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.

Although we don't need tests for something like this, I also think we shouldn't override the defaults unless the user specifies a parameter.

So, a better change would be to make the flag default to -1 (meaning the value is unset) and then only set the value in the config if it's 0 or greater.

That way we're not changing existing behavior in potentially subtle ways.

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.

Ah this is a good callout. @RicardoLorenzo, here an example of how we have done that in the past: #4037

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I'm sorry, I was sick last week and just seeing the comments now. I will look into this.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I have implemented the proposed change.

@deepthi
Copy link
Copy Markdown
Collaborator

deepthi commented Oct 30, 2019

I'm thinking that adding a test for this is to test that the external dependency is respecting the contract. That seems like an anti-pattern.

No need to test for that, my intention was to ask if this had already been sanity-tested.
I have no objection to the change itself.

@rafael
Copy link
Copy Markdown
Member

rafael commented Nov 7, 2019

Looks good. Could you squash the commits? I think for this PR it would be better just to have a single one.

Signed-off-by: Ricardo Lorenzo <rlorenzo@slack-corp.com>
@RicardoLorenzo
Copy link
Copy Markdown
Author

Good point! I have combined the commits into 1 as suggested.

Copy link
Copy Markdown
Member

@rafael rafael left a comment

Choose a reason for hiding this comment

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

LGTM +1

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.

4 participants