-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
ddl: implement the placement rules inheritance logic #28365
Merged
ti-chi-bot
merged 29 commits into
pingcap:master
from
AilinKid:avoid-sync-default-bundle-to-pd
Oct 8, 2021
Merged
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
76baf02
use the persistent policy in parent objects and avoid use pd default …
AilinKid f830bd5
add bundle index and override field
AilinKid 9e0bc16
resolve the nil pointer
AilinKid 38d95f9
add create-table placement inheritance and build independent partion …
AilinKid 8d410fb
add cancel
AilinKid 198d6ec
add comment
AilinKid 2e5be09
address comment
AilinKid 808b5e3
fix test
AilinKid 1603f0d
refactor reset bundle
AilinKid 9b3df33
fix panic
AilinKid 9aadfae
remove useless code
AilinKid 9467df2
fix the alter policy
AilinKid 41d2df0
.
AilinKid edf50df
show the database and partition rules
AilinKid f08f0ff
fix comment blank
AilinKid d94d838
fix the placement sql test
AilinKid 905107b
fix the rules id
AilinKid 6e73fa4
address comment from chao and he
AilinKid f6cd6a9
.
AilinKid 23c81fc
fix test
AilinKid 4545f19
fix bundle
AilinKid 7050f69
fix test
AilinKid 247a8df
change the rule de-duplication to index indentification
AilinKid ad907f3
move tidy to constructors: NewBundleFromOptions
AilinKid e606439
fmt
AilinKid 45a2081
Merge branch 'master' into avoid-sync-default-bundle-to-pd
AilinKid 1ae67cb
Merge branch 'master' into avoid-sync-default-bundle-to-pd
AilinKid dcb801e
fix test
AilinKid 6806823
Merge branch 'master' into avoid-sync-default-bundle-to-pd
AilinKid File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current code about bundles seems some what weird and a little complex now. How about refactoring them to below methods:
I think the above methods is enough for ddl to use. It's not necessary to use
BundleByName
in infoschema because we'll finally delete it and the logic that directly building bundle from meta is more brief and easy to maintain.We do not need method
Tidy
too. We cantidy
the bundle when we constructing it, I think no where requires a not tidied bundle.Another advices is the reuse of the code, for example, we can introduce a private method like
newBundleFromPolicyOrDirectOptions(infoschema.InfoSchema, *model.PolicyRefInfo, *model.PlacementSettings) (*Bundle, error)
It will return a semi-finished Bundle and just for code reuse and it should only be visible in placement package
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1: refactored to
func NewBundleFromTblInfo(t *meta.Meta, job *model.Job, tbInfo *model.TableInfo)
andfunc NewBundleFromPartition(t *meta.Meta, job *model.Job, partition *model.PartitionInfo)
2: tidy moved to constructors---
NewBundleFromOptions
3: the
newBundleFromPolicyOrDirectOptions
function is builtThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AilinKid, where is the change of 2? I don't see that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added, missed in my commits