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

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-8.1 This PR is cherry-picked to release-8.1 from a source PR. labels Jul 29, 2024
@ti-chi-bot ti-chi-bot added the cherry-pick-approved Cherry pick PR approved by release team. label Jul 29, 2024
Copy link

codecov bot commented Jul 29, 2024

Codecov Report

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

Please upload report for BASE (release-8.1@42b624c). Learn more about missing BASE report.

Additional details and impacted files
@@               Coverage Diff                @@
##             release-8.1     #54994   +/-   ##
================================================
  Coverage               ?   72.5558%           
================================================
  Files                  ?       1466           
  Lines                  ?     435707           
  Branches               ?          0           
================================================
  Hits                   ?     316131           
  Misses                 ?      99111           
  Partials               ?      20465           
Flag Coverage Δ
unit 72.5558% <0.0000%> (?)

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

Components Coverage Δ
dumpling 57.8032% <0.0000%> (?)
parser ∅ <0.0000%> (?)
br 41.0576% <0.0000%> (?)

@ti-chi-bot ti-chi-bot bot added approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Jul 31, 2024
@BornChanger
Copy link
Contributor

/retest

Copy link

ti-chi-bot bot commented Aug 5, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: 3pointer, BornChanger

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 and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Aug 5, 2024
Copy link

ti-chi-bot bot commented Aug 5, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-07-31 09:20:53.331859772 +0000 UTC m=+347569.611907855: ☑️ agreed by BornChanger.
  • 2024-08-05 04:04:51.079384929 +0000 UTC m=+238420.946484002: ☑️ agreed by 3pointer.

@RidRisR
Copy link
Contributor

RidRisR commented Aug 5, 2024

/retest

@YuJuncen
Copy link
Contributor

YuJuncen commented Aug 5, 2024

/retest-required

@BornChanger
Copy link
Contributor

/retest

@BornChanger
Copy link
Contributor

/retest

1 similar comment
@BornChanger
Copy link
Contributor

/retest

@ti-chi-bot ti-chi-bot bot merged commit 5863a6f into pingcap:release-8.1 Aug 5, 2024
30 of 45 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-8.1 This PR is cherry-picked to release-8.1 from a source PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants