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

Placement Policy support for dumpling #29371

Closed
Tracked by #18030
morgo opened this issue Nov 2, 2021 · 5 comments
Closed
Tracked by #18030

Placement Policy support for dumpling #29371

morgo opened this issue Nov 2, 2021 · 5 comments
Assignees
Labels
component/dumpling This is related to Dumpling of TiDB. type/feature-request Categorizes issue or PR as related to a new feature.

Comments

@morgo
Copy link
Contributor

morgo commented Nov 2, 2021

Feature Request

This is part of #18030

Is your feature request related to a problem? Please describe:

Currently dumpling supports dumping tables + data, but it does not yet support correctly dumping tables with a PLACEMENT POLICY defined.

Placement Policies can be thought of as similar to "Roles". They are globally scoped and save a set of placement options under a common name. See pingcap/docs#6618 for docs.

Describe the feature you'd like:

Dumpling should use the following procedure to dump placement policies:

  1. Build a list of distinct placement policy names (select distinct policy_name from information_schema.placement_rules;)
  2. Run SHOW CREATE PLACEMENT POLICY foo to get the recreatable version of the policy. This should be written to the top of the dump file.
  3. Append SET PLACEMENT_CHECKS=0 to the start of the dump file. This feature was developed with dumpling in mind, since it should be possible to disable failures if a dump is reimported into a newer server which has stricter interpretations of how placement policies should be validated/specified. It also helps if the labels differ on the physical server where data is being restored (since this should not prevent restore - that could be disasterous).

Describe alternatives you've considered:

None

Teachability, Documentation, Adoption, Migration Strategy:

It should automatically work assuming the server is a TiDB server.

@morgo morgo added the type/feature-request Categorizes issue or PR as related to a new feature. label Nov 2, 2021
@kennytm kennytm added the component/dumpling This is related to Dumpling of TiDB. label Nov 7, 2021
@sylzd
Copy link
Contributor

sylzd commented Nov 10, 2021

@morgo @kennytm Can I try this? any idea or suggestion for me? 🤣

@sylzd
Copy link
Contributor

sylzd commented Nov 10, 2021

/assign

@morgo
Copy link
Contributor Author

morgo commented Nov 10, 2021

Please try! @lichunzhu is a good person to ask for suggestions.

@sylzd
Copy link
Contributor

sylzd commented Dec 3, 2021

@morgo It seems done already, any other work left?

@morgo
Copy link
Contributor Author

morgo commented Dec 6, 2021

@morgo It seems done already, any other work left?

I have added several new issues to #18030 just today (see the "Other" section).

@morgo morgo closed this as completed Dec 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/dumpling This is related to Dumpling of TiDB. type/feature-request Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

No branches or pull requests

3 participants