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

[patch] Refactor agent-sidecar: fix S3 reader & add backoff logic #467

Merged

Conversation

rinx
Copy link
Contributor

@rinx rinx commented Jun 11, 2020

Description:

  • use io.Pipe for reading S3 bucket data
  • add backoff logic for restorer

Related Issue:

nothing.

How Has This Been Tested?:

nothing

Environment:

  • Go Version: 1.14.3
  • Docker Version: 19.03.8
  • Kubernetes Version: 1.18.2
  • NGT Version: 1.11.5

Types of changes:

  • Bug fix [type/bug]
  • New feature [type/feature]
  • Add tests [type/test]
  • Security related changes [type/security]
  • Add documents [type/documentation]
  • Refactoring [type/refactoring]
  • Update dependencies [type/dependency]
  • Update benchmarks and performances [type/bench]
  • Update CI [type/ci]

Changes to Core Features:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your core changes, as applicable?
  • Have you successfully ran tests with your changes locally?

Checklist:

  • I have read the CONTRIBUTING document.
  • I have checked open Pull Requests for the similar feature or fixes?
  • I have added tests and benchmarks to cover my changes.
  • I have ensured all new and existing tests passed.
  • I have commented my code, particularly in hard-to-understand areas
  • I have updated the documentation accordingly.

@pull-assistant
Copy link

pull-assistant bot commented Jun 11, 2020

@codecov
Copy link

codecov bot commented Jun 11, 2020

Codecov Report

Merging #467 into master will decrease coverage by 0.09%.
The diff coverage is 1.71%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #467      +/-   ##
=========================================
- Coverage    7.92%   7.83%   -0.10%     
=========================================
  Files         392     396       +4     
  Lines       20039   20323     +284     
=========================================
+ Hits         1589    1593       +4     
- Misses      18217   18493     +276     
- Partials      233     237       +4     
Impacted Files Coverage Δ
internal/config/sidecar.go 0.00% <0.00%> (ø)
internal/config/transport.go 0.00% <0.00%> (ø)
internal/db/storage/blob/s3/reader/reader.go 0.00% <0.00%> (ø)
internal/db/storage/blob/s3/s3.go 0.00% <0.00%> (ø)
internal/db/storage/blob/s3/session/option.go 21.15% <0.00%> (-1.77%) ⬇️
internal/db/storage/blob/s3/session/session.go 0.00% <0.00%> (ø)
internal/errors/blob.go 0.00% <0.00%> (ø)
internal/net/http/client/client.go 0.00% <0.00%> (ø)
pkg/agent/sidecar/service/restorer/option.go 4.54% <0.00%> (-1.71%) ⬇️
pkg/agent/sidecar/service/restorer/restorer.go 0.00% <0.00%> (ø)
... and 8 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8a608c7...5278819. Read the comment docs.

@vdaas-ci
Copy link
Collaborator

[WARNING] Changes in interal/config may require you to change Helm charts. Please check.

@vdaas-ci
Copy link
Collaborator

[WARNING] Changes in interal/config may require you to change Helm charts. Please check.

@rinx rinx changed the title Refactor agent-sidecar: use io pipe for reading s3 bucket Refactor agent-sidecar: fix S3 reader & add backoff logic Jun 11, 2020
@rinx rinx marked this pull request as ready for review June 11, 2020 03:43
@vdaas-ci
Copy link
Collaborator

[WARNING] Changes in interal/config may require you to change Helm charts. Please check.

internal/db/storage/blob/s3/reader/reader.go Show resolved Hide resolved
internal/errors/blob.go Show resolved Hide resolved
internal/errors/blob.go Show resolved Hide resolved
internal/errors/blob_test.go Outdated Show resolved Hide resolved
@vdaas-ci
Copy link
Collaborator

[WARNING] Changes in interal/config may require you to change Helm charts. Please check.

@github-actions github-actions bot added size/XXL and removed size/XL labels Jun 12, 2020
return nil
}

}
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
block should not end with a whitespace (or comment) (wsl)

internal/net/http/client/option_test.go Show resolved Hide resolved
internal/net/http/client/option_test.go Show resolved Hide resolved
internal/net/http/client/option_test.go Show resolved Hide resolved
internal/net/http/client/option.go Show resolved Hide resolved
internal/errors/blob_test.go Outdated Show resolved Hide resolved
@vdaas-ci
Copy link
Collaborator

[WARNING] Changes in interal/config may require you to change Helm charts. Please check.

// Change interface type to the type of object you are testing
type T = interface{}
type args struct {
client *http.Client
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
client is unused (structcheck)

@vdaas-ci
Copy link
Collaborator

[WARNING] Changes in interal/config may require you to change Helm charts. Please check.

kpango
kpango previously approved these changes Jun 12, 2020
Copy link
Collaborator

@kpango kpango left a comment

Choose a reason for hiding this comment

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

LGTM

@kpango kpango changed the title Refactor agent-sidecar: fix S3 reader & add backoff logic [patch] Refactor agent-sidecar: fix S3 reader & add backoff logic Jun 12, 2020
@kpango
Copy link
Collaborator

kpango commented Jun 12, 2020

/rebase
/format
/changelog
/approve

@vdaas-ci
Copy link
Collaborator

vdaas-ci commented Jun 12, 2020

[CHANGELOG] Please edit the following lines.

  • Refactor agent-sidecar: fix S3 reader & add backoff logic (#467)
  • 🐛 📝 fix link (#471)
  • Fix /changelog command format (#470)
  • fix: failing test (#469)
  • fix: failing test (#468)
  • ✨ Add options for AWS client (#460)
  • Fix /format command (#466)
  • Fix /format command (#465)
  • Fix internal/log/retry pacakge (#458)
  • 🎨 trim white margin at data flow images (#459)

@vdaas-ci
Copy link
Collaborator

[REBASE] Rebase triggered by kpango for branch: refactor/agent-sidecar/use-io-pipe-for-reading-s3-backet

rinx added 10 commits June 12, 2020 09:52
Signed-off-by: Rintaro Okamura <rintaro.okamura@gmail.com>
Signed-off-by: Rintaro Okamura <rintaro.okamura@gmail.com>
Signed-off-by: Rintaro Okamura <rintaro.okamura@gmail.com>
Signed-off-by: Rintaro Okamura <rintaro.okamura@gmail.com>
Signed-off-by: Rintaro Okamura <rintaro.okamura@gmail.com>
Signed-off-by: Rintaro Okamura <rintaro.okamura@gmail.com>
Signed-off-by: Rintaro Okamura <rintaro.okamura@gmail.com>
Signed-off-by: Rintaro Okamura <rintaro.okamura@gmail.com>
Signed-off-by: Rintaro Okamura <rintaro.okamura@gmail.com>
Signed-off-by: Rintaro Okamura <rintaro.okamura@gmail.com>
@vdaas-ci vdaas-ci force-pushed the refactor/agent-sidecar/use-io-pipe-for-reading-s3-backet branch from 05aa4bd to 35fe989 Compare June 12, 2020 09:52
@vdaas-ci
Copy link
Collaborator

[WARNING] Changes in interal/config may require you to change Helm charts. Please check.

@vdaas-ci
Copy link
Collaborator

[FORMAT] Updating license headers and formatting go codes triggered by kpango.

@vdaas-ci
Copy link
Collaborator

[WARNING] Changes in interal/config may require you to change Helm charts. Please check.

Copy link
Collaborator

@vdaas-ci vdaas-ci left a comment

Choose a reason for hiding this comment

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

[APPROVED] This PR is approved by kpango.

// Change interface type to the type of object you are testing
type T = interface{}
type args struct {
client *http.Client
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
field client is unused (unused)

@@ -59,3 +60,15 @@ func WithBlobStorage(storage storage.Storage) Option {
return nil
}
}

func WithBackoffOpts(opts ...backoff.Option) Option {
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
exported function WithBackoffOpts should have comment or be unexported (golint)

@kpango kpango merged commit b26ac79 into master Jun 12, 2020
@kpango kpango deleted the refactor/agent-sidecar/use-io-pipe-for-reading-s3-backet branch June 12, 2020 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants