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) #57031

Merged

Conversation

ti-chi-bot
Copy link
Member

This is an automated cherry-pick of #54150

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 added 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. type/cherry-pick-for-release-7.1 This PR is cherry-picked to release-7.1 from a source PR. labels Oct 31, 2024
@BornChanger
Copy link
Contributor

/retest

@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Nov 3, 2024
Copy link

codecov bot commented Nov 3, 2024

Codecov Report

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

Please upload report for BASE (release-7.1@c5dc4ba). Learn more about missing BASE report.

Additional details and impacted files
@@               Coverage Diff                @@
##             release-7.1     #57031   +/-   ##
================================================
  Coverage               ?   73.4542%           
================================================
  Files                  ?       1211           
  Lines                  ?     380724           
  Branches               ?          0           
================================================
  Hits                   ?     279658           
  Misses                 ?      83221           
  Partials               ?      17845           

Copy link

ti-chi-bot bot commented Nov 11, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: BornChanger, Leavrth

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 ti-chi-bot bot added lgtm approved and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Nov 11, 2024
Copy link

ti-chi-bot bot commented Nov 11, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-11-03 08:03:49.289451957 +0000 UTC m=+768942.128607498: ☑️ agreed by BornChanger.
  • 2024-11-11 03:19:51.345313011 +0000 UTC m=+239953.536182007: ☑️ agreed by Leavrth.

@ti-chi-bot ti-chi-bot bot merged commit 90ea972 into pingcap:release-7.1 Nov 11, 2024
36 of 39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved cherry-pick-approved Cherry pick PR approved by release team. lgtm 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. type/cherry-pick-for-release-7.1 This PR is cherry-picked to release-7.1 from a source PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants