-
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
executor, ddl: support database placement option and partition placement option #28025
executor, ddl: support database placement option and partition placement option #28025
Conversation
[REVIEW NOTIFICATION] This pull request has been approved by:
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. |
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.
Overall LGTM
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.
Oops, I missed this and did some duplicated work (but good for my own understanding) here:
#27969
ddl/ddl_api.go
Outdated
var opt *ast.CharsetOpt | ||
if len(dbOps) != 0 { | ||
opt = &ast.CharsetOpt{} | ||
for _, val := range dbOps { |
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.
This looks like it is duplicated and would benefit from a common function, similar to this:
https://github.com/pingcap/tidb/pull/27969/files#diff-b7c54f7dad7257cbe4fa04b8d76c9bed694e2e2e7c5599f45eb2172d8d4ff8a7R2289
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.
This looks like it is duplicated and would benefit from a common function, similar to this:
https://github.com/pingcap/tidb/pull/27969/files#diff-b7c54f7dad7257cbe4fa04b8d76c9bed694e2e2e7c5599f45eb2172d8d4ff8a7R2289
I will revoke the part of schema and use the common func that named SetDirectPlacementOpt to simple code after your pr be merged .
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.
Rest LGTM
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.
pingcap/parser#1342 has been merged, you could update the parser and remove replace directives.
bfeedc2
to
483b82b
Compare
/rebuild |
/run-check_dev_2 |
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.
LGTM with one suggestion below.
ddl/table.go
Outdated
job.State = model.JobStateCancelled | ||
return 0, errors.Trace(table.ErrUnknownPartition.GenWithStackByArgs("drop?", tblInfo.Name.O)) | ||
} | ||
for idx, ptDef := range ptInfo.Definitions { |
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.
Looking at (*PartitionInfo) GetNameByID
, it looks like this could be done similarly, including the check for existence above.
I.e. could you remove the if ptInfo.GetNameByID(partitionID) ...
and replace the loop here with for i := range ptInfo.Definitions {
and then check afterwards if the partition was found and if not return the error? Then you will only iterate over the array once, and according to the note in GetNameByID it is also faster.
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.
done
@mjonss: Thanks for your review. The bot only counts approvals from reviewers and higher roles in list, but you're still welcome to leave your comments. In response to this:
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 ti-community-infra/tichi repository. |
LGTM also, but I will wait for @mjonss ' comment to be answered before approving/merging. |
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.
LGTM
We could a release note in other PRs. There are too many PRs related to the feature.
I think it is a mistake by @zhaoxugang , he may want to say 'refer' or 'related'. |
I have fixed it |
@zhaoxugang thanks. I've updated the release note part to @zhaoxugang please fix go.mod conflict. /assign @xhebox Can we merge this PR later or we still wait for another committer's approval? |
No, it can be merged now. I believe the release note is included in #27969 /merge |
This pull request has been accepted and is ready to merge. Commit hash: c3d6792
|
@zhaoxugang: Your PR was out of date, I have automatically updated it for you. At the same time I will also trigger all tests for you: /run-all-tests If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes. 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 ti-community-infra/tichi repository. |
What problem does this PR solve?
Issue Number: refer to #26581
Depends on parser PR pingcap/parser#1342
This closes #27973 .
Check List
Tests
Side effects
Documentation
Release note