tidb
tidb copied to clipboard
br: fix backup to aliyum OSS not support ak/sk as env
What problem does this PR solve?
Issue Number: close https://github.com/pingcap/tidb/issues/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
- [x] Manual test (add detailed scripts or steps below)
- [ ] No need to test
- [ ] I checked and no code files have been changed.
Protocol:
- Set access-key and secret-access-key as my local machine environmental variable.
- Try
br backup fullfrom a public address (my local machine) without ISM access-key. - Check if the full backup task finished and if the Aliyun OSS server received the backup files.
Result:
- 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]
- On the Aliyun OSS machine
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.
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.
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%) |
:arrow_up: |
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%) |
:arrow_up: |
/test unit-test
@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.
/test unit-test
@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.
/test unit-test
@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.
@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.
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: Leavrth, YuJuncen
The full list of commands accepted by this bot can be found here.
The pull request process is described here
- ~~br/pkg/storage/OWNERS~~ [Leavrth,YuJuncen]
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
[LGTM Timeline notifier]
Timeline:
/test fast_test_tiprow
@RidRisR: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:
/test build/test check-dev/test check-dev2/test mysql-test/test pull-br-integration-test/test pull-integration-ddl-test/test pull-lightning-integration-test/test pull-mysql-client-test/test unit-test
The following commands are available to trigger optional jobs:
/test canary-notify-when-compatibility-sections-changed/test pingcap/tidb/canary_ghpr_unit_test/test pull-common-test/test pull-e2e-test/test pull-integration-common-test/test pull-integration-copr-test/test pull-integration-jdbc-test/test pull-integration-mysql-test/test pull-integration-nodejs-test/test pull-sqllogic-test/test pull-tiflash-test
Use /test all to run the following jobs that were automatically triggered:
pingcap/tidb/ghpr_buildpingcap/tidb/ghpr_checkpingcap/tidb/ghpr_check2pingcap/tidb/ghpr_mysql_testpingcap/tidb/ghpr_unit_testpingcap/tidb/pull_br_integration_testpingcap/tidb/pull_integration_ddl_testpingcap/tidb/pull_lightning_integration_testpingcap/tidb/pull_mysql_client_test
In response to this:
/test fast_test_tiprow
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: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.
In response to this:
/test fast_test_tiprow
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.
/test mysql-test
/test pull-br-integration-test
@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.
@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.
/ok-to-test
/test unit-test
@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.
/test unit-test
@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.
/retest
/test check-dev2
@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.
/retest-required
In response to a cherrypick label: new pull request created to branch release-7.5: #54579.
In response to a cherrypick label: new pull request created to branch release-8.1: #54994.
In response to a cherrypick label: new pull request created to branch release-7.1: #57031.