Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Make Lightning S3 use force-path-style=true by default (#903)#922

Merged
ti-chi-bot merged 3 commits into
pingcap:release-4.0from
ti-srebot:release-4.0-1e53766686e1
Jul 6, 2021
Merged

Make Lightning S3 use force-path-style=true by default (#903)#922
ti-chi-bot merged 3 commits into
pingcap:release-4.0from
ti-srebot:release-4.0-1e53766686e1

Conversation

@ti-srebot
Copy link
Copy Markdown
Contributor

@ti-srebot ti-srebot commented Mar 24, 2021

cherry-pick #903 to release-4.0
You can switch your code base to this Pull Request by using git-extras:

# In br repo:
git pr https://github.com/pingcap/br/pull/922

After apply modifications, you can push your change to this PR via:

git push git@github.com:ti-srebot/br.git pr/922:release-4.0-1e53766686e1

What problem does this PR solve?

Lightning is different from BR and Dumpling that force-path-style is false by default. This is because both BR and Dumpling reads the storage URL through (*BackendOptions).ParseFromFlags which sets ForcePathStyle to true:

options.ForcePathStyle = true

but such adjustment is absent from Lightning.

What is changed and how it works?

We set the default ForcePathStyle to true inside storage.ParseBackend so Lightning, starting with the default backend options, will also use force-path-style=true by default.

Also fixed the unit tests on Windows.

Check List

Tests

  • Unit test

Code changes

Side effects

  • Breaking backward compatibility
    • Lightning uses force-path-style=true by default, instead of force-path-style=false.

Related changes

Release Note

  • Then importing from S3, Lightning now uses force-path-style=true by default, aligning with BR and Dumpling. To use the virtual host addressing style, explicitly set the force-path-style option like:

    ./tidb-lightning -d 's3://bucket/path?force-path-style=0&...'

Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
Comment thread pkg/storage/parse_test.go Outdated
@glorv
Copy link
Copy Markdown
Collaborator

glorv commented Mar 24, 2021

/lgtm

@ti-chi-bot ti-chi-bot added the status/LGT1 LGTM1 label Mar 24, 2021
@ti-chi-bot
Copy link
Copy Markdown
Member

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • glorv
  • kennytm

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Details

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@kennytm
Copy link
Copy Markdown
Collaborator

kennytm commented Jul 6, 2021

/merge

@ti-chi-bot
Copy link
Copy Markdown
Member

This pull request has been accepted and is ready to merge.

DetailsCommit hash: c413bcf

@ti-chi-bot ti-chi-bot merged commit f56c7e9 into pingcap:release-4.0 Jul 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants