tidb icon indicating copy to clipboard operation
tidb copied to clipboard

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

Open RidRisR opened this issue 1 year ago • 24 comments

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:

  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.

RidRisR avatar Jun 21 '24 02:06 RidRisR

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.

tiprow[bot] avatar Jun 21 '24 02:06 tiprow[bot]

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:

codecov[bot] avatar Jun 21 '24 03:06 codecov[bot]

/test unit-test

RidRisR avatar Jun 21 '24 08:06 RidRisR

@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.

tiprow[bot] avatar Jun 21 '24 08:06 tiprow[bot]

/test unit-test

RidRisR avatar Jun 21 '24 09:06 RidRisR

@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.

tiprow[bot] avatar Jun 21 '24 09:06 tiprow[bot]

/test unit-test

RidRisR avatar Jun 24 '24 02:06 RidRisR

@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.

tiprow[bot] avatar Jun 24 '24 02:06 tiprow[bot]

@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.

ti-chi-bot[bot] avatar Jun 28 '24 05:06 ti-chi-bot[bot]

[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

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

ti-chi-bot[bot] avatar Jun 28 '24 06:06 ti-chi-bot[bot]

[LGTM Timeline notifier]

Timeline:

  • 2024-06-27 07:24:51.388011506 +0000 UTC m=+877217.873500339: :ballot_box_with_check: agreed by YuJuncen.
  • 2024-06-28 06:32:57.239023914 +0000 UTC m=+960503.724512746: :ballot_box_with_check: agreed by Leavrth.

ti-chi-bot[bot] avatar Jun 28 '24 06:06 ti-chi-bot[bot]

/test fast_test_tiprow

RidRisR avatar Jun 28 '24 06:06 RidRisR

@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_build
  • pingcap/tidb/ghpr_check
  • pingcap/tidb/ghpr_check2
  • pingcap/tidb/ghpr_mysql_test
  • pingcap/tidb/ghpr_unit_test
  • pingcap/tidb/pull_br_integration_test
  • pingcap/tidb/pull_integration_ddl_test
  • pingcap/tidb/pull_lightning_integration_test
  • pingcap/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.

ti-chi-bot[bot] avatar Jun 28 '24 06:06 ti-chi-bot[bot]

@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.

tiprow[bot] avatar Jun 28 '24 06:06 tiprow[bot]

/test mysql-test

RidRisR avatar Jun 28 '24 07:06 RidRisR

/test pull-br-integration-test

RidRisR avatar Jun 28 '24 07:06 RidRisR

@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.

tiprow[bot] avatar Jun 28 '24 07:06 tiprow[bot]

@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.

tiprow[bot] avatar Jun 28 '24 07:06 tiprow[bot]

/ok-to-test

YuJuncen avatar Jun 28 '24 08:06 YuJuncen

/test unit-test

RidRisR avatar Jul 01 '24 02:07 RidRisR

@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.

tiprow[bot] avatar Jul 01 '24 02:07 tiprow[bot]

/test unit-test

RidRisR avatar Jul 01 '24 02:07 RidRisR

@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.

tiprow[bot] avatar Jul 01 '24 02:07 tiprow[bot]

/retest

hawkingrei avatar Jul 01 '24 08:07 hawkingrei

/test check-dev2

RidRisR avatar Jul 02 '24 02:07 RidRisR

@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.

tiprow[bot] avatar Jul 02 '24 02:07 tiprow[bot]

/retest-required

YuJuncen avatar Jul 02 '24 04:07 YuJuncen

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

ti-chi-bot avatar Jul 11 '24 08:07 ti-chi-bot

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

ti-chi-bot avatar Jul 29 '24 06:07 ti-chi-bot

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

ti-chi-bot avatar Oct 31 '24 08:10 ti-chi-bot