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

Merged
kennytm merged 3 commits into
pingcap:masterfrom
kennytm:lightning-s3-force-path-style-by-default
Mar 24, 2021
Merged

Make Lightning S3 use force-path-style=true by default #903
kennytm merged 3 commits into
pingcap:masterfrom
kennytm:lightning-s3-force-path-style-by-default

Conversation

@kennytm
Copy link
Copy Markdown
Collaborator

@kennytm kennytm commented Mar 20, 2021

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&...'

@kennytm kennytm force-pushed the lightning-s3-force-path-style-by-default branch from 35806ee to 152d109 Compare March 20, 2021 11:24
@glorv
Copy link
Copy Markdown
Collaborator

glorv commented Mar 22, 2021

/lgtm

@ti-srebot ti-srebot added the status/LGT1 LGTM1 label Mar 22, 2021
@YuJuncen
Copy link
Copy Markdown
Collaborator

/lgtm

@ti-srebot ti-srebot removed the status/LGT1 LGTM1 label Mar 24, 2021
@ti-srebot ti-srebot added the status/LGT2 LGTM2 label Mar 24, 2021
@kennytm
Copy link
Copy Markdown
Collaborator Author

kennytm commented Mar 24, 2021

/merge

@ti-srebot
Copy link
Copy Markdown
Contributor

/run-all-tests

@kennytm kennytm merged commit 1e53766 into pingcap:master Mar 24, 2021
@kennytm kennytm deleted the lightning-s3-force-path-style-by-default branch March 24, 2021 09:56
ti-srebot pushed a commit to ti-srebot/br that referenced this pull request Mar 24, 2021
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@ti-srebot
Copy link
Copy Markdown
Contributor

cherry pick to release-4.0 in PR #922

ti-srebot pushed a commit to ti-srebot/br that referenced this pull request Mar 24, 2021
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@ti-srebot
Copy link
Copy Markdown
Contributor

cherry pick to release-5.0 in PR #923

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.

4 participants