-
Notifications
You must be signed in to change notification settings - Fork 6k
ddl: Corrected index management during REORGANIZE PARTITION #56786
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
Conversation
Hi @mjonss. 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 ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #56786 +/- ##
================================================
+ Coverage 72.8906% 74.7688% +1.8782%
================================================
Files 1672 1717 +45
Lines 462275 470327 +8052
================================================
+ Hits 336955 351658 +14703
+ Misses 104560 96586 -7974
- Partials 20760 22083 +1323
Flags with carried forward coverage won't be shown. Click here to find out more.
|
/retest |
@Defined2014: Cannot trigger testing until a trusted user reviews the PR and leaves an 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 kubernetes-sigs/prow repository. |
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.
resulting in they would not continue to be updated, so in case of a rollback there might be missing entries.
Can you clarify which sql in the newly added test case covers this problem? And what's the result before this PR?
Since the indexes was in StateDeleteReorganization, during |
Thanks your comments. I have an another question, does it mean we could cancel reorg partition ddl job in any state? I can't found any information in |
Still some debug and cleanup to do.
Since we will continue to double write until all processing is done and the old partitions cannot be accessed any longer, it is possible to cancel the DDL Job in any state and the rollback should work. I have not tested the Cancel part, though, do you have any example of tests that I can replicate @Defined2014 ? |
/retest |
@mjonss: Cannot trigger testing until a trusted user reviews the PR and leaves an 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 kubernetes-sigs/prow repository. |
if indexInfo.Unique && | ||
indexInfo.State == model.StateDeleteReorganization && | ||
tblInfo.Partition.DDLState == model.StateDeleteReorganization { | ||
if indexInfo.State == model.StateWriteOnly { |
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.
Why only drop the write-only indexes? What about other states? For example, what will happen when we rollback from the "none -> delete-only" step?
There may be delete-only
indexes before converting to rolling back job:
newIndex := index.Clone()
newIndex.State = model.StateDeleteOnly
newIndex.ID = AllocateIndexID(tblInfo)
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.
There should only be either StatePublic
or StateWriteOnly
so only write-only indexes that should be removed. Also in the follow ups #57114 and #56974 (based on this PR) it will block the rollback here and here for the last state. One can see this PR a part 1 of 3, where the optimistic path works, then the failure/rollback/cleanup is fixed in part 2 and 3.
It seems that rolling back only takes 1 schema version to complete. I am trying to figure out how it works... |
@tangenta it should take two, one when converting the failed DDL to rollback, and one as a second step in |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Defined2014, tangenta The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
[LGTM Timeline notifier]Timeline:
|
@mjonss: 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. |
// Untouched index | ||
DroppingDefinitionIndices = append(DroppingDefinitionIndices, idx) | ||
if pi.DDLState != model.StateDeleteReorganization { | ||
// If pi.DDLState == DeleteReorg, then keep the StatePublic. |
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.
Why is the state of the index public?
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.
To not skip it when inserting into the index, StateDeleteReorganization
would work similar to StateDeleteOnly
so that is why keeping the index state as StatePublic
instead of StateDeleteReorganization
, to keep it double written during the delete reorganization phase.
In response to a cherrypick label: new pull request created to branch |
What problem does this PR solve?
Issue Number: close #56634
Problem Summary:
issue triggered by injected error, resulting in rollback and panic
Uncovered issues:
What changed and how does it work?
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.