-
Notifications
You must be signed in to change notification settings - Fork 6k
ddl, model: fix unexpected missing analyze for multi schema change #64337
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
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Ruihao Chen <[email protected]>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
Hi @joechenrh. Thanks for your PR. PRs from untrusted users cannot be marked as trusted with I understand the commands that are listed here. 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-sigs/prow repository. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #64337 +/- ##
================================================
+ Coverage 72.7418% 74.1633% +1.4214%
================================================
Files 1859 1883 +24
Lines 504114 513747 +9633
================================================
+ Hits 366702 381012 +14310
+ Misses 115137 108881 -6256
- Partials 22275 23854 +1579
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Signed-off-by: Ruihao Chen <[email protected]>
Signed-off-by: Ruihao Chen <[email protected]>
Signed-off-by: Ruihao Chen <[email protected]>
|
/ok-to-test |
Signed-off-by: Ruihao Chen <[email protected]>
|
@joechenrh: The following test failed, say
Full PR test history. Your PR dashboard. 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-sigs/prow repository. I understand the commands that are listed here. |
|
@joechenrh: The following tests failed, say
Full PR test history. Your PR dashboard. 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-sigs/prow repository. I understand the commands that are listed here. |
What problem does this PR solve?
Issue Number: ref #63366
Problem Summary:
If the last sub job in the multi schema change doesn't need reorg (i.e., no index involved), the analyze task will be skipped.
Take the following SQL as example, since
c2has no index on it, the state is directly converted toAnalyzeStateSkipped, even if modifyingc1requires reorg.What changed and how does it work?
The problems is caused by inaccurate value for
SubJob.NeedAnalyze. That is, the last job withNeedAnalyze == trueis not the last job that does reorg. To fix this:CtxVarswith boolean value, this value is not accurate and is only used in job submission (we can only get the ModifyColumnType during execution)NeedAnalyzebefore each subjob becoming non-revertible. ForMODIFY COLUMN, it's set during ddl execution, while forADD INDEX, we can just set it during submission.NeedAnalyze=trueNeedAnalyze=trueAnalyzeStateSkippedis removed, since we need do the check before updating the table meta.One of the biggest change after this PR is that, the multi-schema-change is marked as non-revertible after all reorg is finish, not analyze is finished.
This PR also do the following things
ddltomodelpackage.auto analyze table all indexes, columns a, b, c,_Col$_c_0 with 256 buckets, 100 topn, 1 samplerateCheck List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.