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

br: fix backup to aliyum OSS not support ak/sk as env #54150

Merged
merged 9 commits into from
Jul 2, 2024

Conversation

RidRisR
Copy link
Contributor

@RidRisR RidRisR commented Jun 21, 2024

What problem does this PR solve?

Issue Number: close #45551

Problem Summary:

What changed and how does it work?

Fix the problem that BR only accept credentials from ISM service.
Now, if the BR can't get the ISM credentials, it will try to retrieve credentials from other sources.
And even if it got, it will still try to apply env provider and then shared provider first.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No need to test
    • I checked and no code files have been changed.

Protocol:

  1. Set access-key and secret-access-key as my local machine environmental variable.
  2. Try br backup full from a public address (my local machine) without ISM access-key.
  3. Check if the full backup task finished and if the Aliyun OSS server received the backup files.

Result:

  1. On my local machine:
./bin/br backup full     --pd "localhost:45129"     --storage "s3://test-cred/backup-data-2?endpoint=https://oss-cn-beijing.aliyuncs.com&provider=alibaba" --check-requirements=false
Detail BR log in /tmp/br.log.2024-06-27T15.12.35+0800 
Full Backup <------------------------------------------------------------------> 100.00%
Checksum <---------------------------------------------------------------------> 100.00%
[2024/06/27 15:13:10.064 +08:00] [INFO] [collector.go:77] ["Full Backup success summary"
] [total-ranges=13] [ranges-succeed=13] [ranges-failed=0] [backup-checksum=75.981913ms] [backup-fast-checksum=59.160314ms] [backup-total-ranges=119] [backup-total-regions=119] [total-take=34.226278783s] [BackupTS=450749369217187841] [total-kv=1402] [total-kv-size=409kB] [average-speed=11.95kB/s] [backup-data-size(after-compressed)=92.64kB] [Size=92636]                                                                                      
  1. On the Aliyun OSS machine
截屏2024-06-27 15 19 08

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

Fix the problem that BR only accept credentials from ISM service.
Now, if the BR can't get the ISM credentials, it will behave as same as other endpoints and try to retrieve credentials from other sources. 
And even if it got, it will still try to apply env provider and then shared provider first.

@ti-chi-bot ti-chi-bot bot added do-not-merge/needs-tests-checked release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jun 21, 2024
Copy link

tiprow bot commented Jun 21, 2024

Hi @RidRisR. Thanks for your PR.

PRs from untrusted users cannot be marked as trusted with /ok-to-test in this repo meaning untrusted PR authors can never trigger tests themselves. Collaborators can still trigger tests on the PR using /test all.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Copy link

codecov bot commented Jun 21, 2024

Codecov Report

Attention: Patch coverage is 0% with 15 lines in your changes missing coverage. Please review.

Project coverage is 57.2932%. Comparing base (31c1de0) to head (246b973).
Report is 968 commits behind head on master.

Additional details and impacted files
@@                Coverage Diff                @@
##             master     #54150         +/-   ##
=================================================
- Coverage   72.8144%   57.2932%   -15.5213%     
=================================================
  Files          1524       1677        +153     
  Lines        435824     620323     +184499     
=================================================
+ Hits         317343     355403      +38060     
- Misses        98833     240630     +141797     
- Partials      19648      24290       +4642     
Flag Coverage Δ
integration 40.0761% <0.0000%> (?)
unit 72.3097% <0.0000%> (+0.4908%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
dumpling 52.9656% <ø> (ø)
parser ∅ <ø> (∅)
br 63.0778% <0.0000%> (+16.9462%) ⬆️

br/pkg/storage/s3.go Outdated Show resolved Hide resolved
@RidRisR
Copy link
Contributor Author

RidRisR commented Jun 21, 2024

/test unit-test

Copy link

tiprow bot commented Jun 21, 2024

@RidRisR: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/test unit-test

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@RidRisR
Copy link
Contributor Author

RidRisR commented Jun 21, 2024

/test unit-test

Copy link

tiprow bot commented Jun 21, 2024

@RidRisR: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/test unit-test

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@RidRisR
Copy link
Contributor Author

RidRisR commented Jun 24, 2024

/test unit-test

Copy link

tiprow bot commented Jun 24, 2024

@RidRisR: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/test unit-test

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@ti-chi-bot ti-chi-bot bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed do-not-merge/needs-linked-issue do-not-merge/needs-tests-checked release-note-none Denotes a PR that doesn't merit a release note. labels Jun 24, 2024
@ti-chi-bot ti-chi-bot bot added approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Jun 27, 2024
br/pkg/storage/s3.go Outdated Show resolved Hide resolved
@ti-chi-bot ti-chi-bot bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jun 27, 2024
@ti-chi-bot ti-chi-bot bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jun 27, 2024
Copy link

ti-chi-bot bot commented Jun 28, 2024

@YuJuncen: Your lgtm message is repeated, so it is ignored.

In response to this:

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@RidRisR
Copy link
Contributor Author

RidRisR commented Jun 28, 2024

/test mysql-test

@RidRisR
Copy link
Contributor Author

RidRisR commented Jun 28, 2024

/test pull-br-integration-test

Copy link

tiprow bot commented Jun 28, 2024

@RidRisR: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/test mysql-test

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Copy link

tiprow bot commented Jun 28, 2024

@RidRisR: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/test pull-br-integration-test

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@YuJuncen
Copy link
Contributor

/ok-to-test

@ti-chi-bot ti-chi-bot bot added the ok-to-test Indicates a PR is ready to be tested. label Jun 28, 2024
@RidRisR
Copy link
Contributor Author

RidRisR commented Jul 1, 2024

/test unit-test

Copy link

tiprow bot commented Jul 1, 2024

@RidRisR: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

  • /test fast_test_tiprow
  • /test tidb_parser_test

Use /test all to run all jobs.

In response to this:

/test unit-test

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@RidRisR
Copy link
Contributor Author

RidRisR commented Jul 1, 2024

/test unit-test

Copy link

tiprow bot commented Jul 1, 2024

@RidRisR: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

  • /test fast_test_tiprow
  • /test tidb_parser_test

Use /test all to run all jobs.

In response to this:

/test unit-test

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@hawkingrei
Copy link
Member

/retest

@RidRisR
Copy link
Contributor Author

RidRisR commented Jul 2, 2024

/test check-dev2

Copy link

tiprow bot commented Jul 2, 2024

@RidRisR: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

  • /test fast_test_tiprow
  • /test tidb_parser_test

Use /test all to run all jobs.

In response to this:

/test check-dev2

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@YuJuncen
Copy link
Contributor

YuJuncen commented Jul 2, 2024

/retest-required

@ti-chi-bot ti-chi-bot bot merged commit 9d860fc into pingcap:master Jul 2, 2024
33 checks passed
@ti-chi-bot ti-chi-bot added the needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. label Jul 11, 2024
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-7.5: #54579.

@ti-chi-bot ti-chi-bot added the needs-cherry-pick-release-8.1 Should cherry pick this PR to release-8.1 branch. label Jul 29, 2024
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-8.1: #54994.

@ti-chi-bot ti-chi-bot bot added the needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. label Oct 31, 2024
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-7.1: #57031.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. needs-cherry-pick-release-8.1 Should cherry pick this PR to release-8.1 branch. ok-to-test Indicates a PR is ready to be tested. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

br backup to aliyum OSS not support ak/sk as env
6 participants