-
Notifications
You must be signed in to change notification settings - Fork 489
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
parser: create and alter placement policy #1305
Conversation
Signed-off-by: xhe <[email protected]>
Signed-off-by: xhe <[email protected]>
Signed-off-by: ailinkid <[email protected]>
Signed-off-by: ailinkid <[email protected]>
[REVIEW NOTIFICATION] This pull request has not been approved. To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
DatabaseOptionPlacementPrimaryRegion | ||
DatabaseOptionPlacementRegions | ||
DatabaseOptionPlacementFollowerCount | ||
DatabaseOptionPlacementVoterCount | ||
DatabaseOptionPlacementLearnerCount | ||
DatabaseOptionPlacementSchedule | ||
DatabaseOptionPlacementConstraints | ||
DatabaseOptionPlacementLeaderConstraints | ||
DatabaseOptionPlacementLearnerConstraints | ||
DatabaseOptionPlacementFollowerConstraints | ||
DatabaseOptionPlacementVoterConstraints | ||
DatabaseOptionPlacementPolicy |
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.
how about defining the db options to have the same values as the table options like
DatabaseOptionPlacementPrimaryRegion = DatabaseOptionType(TableOptionPlacementPrimaryRegion)
DatabaseOptionPlacementRegions = DatabaseOptionType(TableOptionPlacementRegions)
// etc
...
@@ -94,6 +109,13 @@ func (n *DatabaseOption) Restore(ctx *format.RestoreCtx) error { | |||
ctx.WriteKeyWord("ENCRYPTION") | |||
ctx.WritePlain(" = ") | |||
ctx.WriteString(n.Value) | |||
case DatabaseOptionPlacementPrimaryRegion, DatabaseOptionPlacementRegions, DatabaseOptionPlacementFollowerCount, DatabaseOptionPlacementLeaderConstraints, DatabaseOptionPlacementLearnerCount, DatabaseOptionPlacementVoterCount, DatabaseOptionPlacementSchedule, DatabaseOptionPlacementConstraints, DatabaseOptionPlacementFollowerConstraints, DatabaseOptionPlacementVoterConstraints, DatabaseOptionPlacementLearnerConstraints, DatabaseOptionPlacementPolicy: | |||
tblOpt := TableOption{ | |||
Tp: TableOptionType(n.Tp-DatabaseOptionPlacementPrimaryRegion) + TableOptionPlacementPrimaryRegion, |
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 thing is, here we rely on the db options are declared in the same order as the table options, which is not clear on either declaration site (lines 76 and 1908).
if the order in either side is changed (as there is no explicit relationship mentioned) this will be restored to the wrong option.
@AilinKid: PR needs rebase. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
move to #1313 |
What problem does this PR solve?
support create and alter placement policy
What is changed and how it works?
add syntax for
1:
create placement policy if not exists x placement_opts
2:
alter placement policy if exists x placement_opts
this is based on #1299, wait for it merged first.
Check List
Tests
Related changes