-
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: Reorganize partition supporting global index #53277
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 #53277 +/- ##
=================================================
- Coverage 74.4295% 55.6279% -18.8017%
=================================================
Files 1506 1626 +120
Lines 357522 609915 +252393
=================================================
+ Hits 266102 339283 +73181
- Misses 71987 247667 +175680
- Partials 19433 22965 +3532
Flags with carried forward coverage won't be shown. Click here to find out more.
|
/ok-to-test |
/retest |
[LGTM Timeline notifier]Timeline:
|
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.
7/11, will review later
Co-authored-by: tangenta <[email protected]>
// If not including all partitioning columns, make it Global | ||
newIndex.Global = true | ||
} | ||
tblInfo.Indices = append(tblInfo.Indices, newIndex) |
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.
It seems there is a chance to have two "primary keys", I am not sure if there are problems
CREATE TABLE `t3` (
`a` int(11) NOT NULL,
`b` int(11) DEFAULT NULL,
PRIMARY KEY (`a`) /*T![clustered_index] NONCLUSTERED */,
UNIQUE KEY `idx_b` (`b`),
UNIQUE KEY `idx_a` (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin
PARTITION BY HASH (`a`) PARTITIONS 3
alter table t3 partition by hash(b) partitions 3;
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.
Maybe we can add DML tests during reorganizing partitions in next PR.
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 one 'PRIMARY KEY' (due to definition of what a primary key is) but multiple candidate keys are possible (i.e. unique indexes of not null columns), both using global index as well as non-partitioned tables.
Also I don't think there are any limitations for having duplicate indexes with different names, are there?
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.
Also I don't think there are any limitations for having duplicate indexes with different names, are there?
+1
I mean there are multiple indexes with index.Primary == true
during reorg partitions, it breaks the assumption of "there is only one primary index at anytime". But I can't figure out any scenarios that can cause errors for now
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Defined2014, jiyfhust, 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 |
Signed-off-by: ti-chi-bot <[email protected]>
In response to a cherrypick label: new pull request created to branch |
In response to a cherrypick label: new pull request created to branch |
What problem does this PR solve?
Issue Number: ref #45133
REORGANIZE PARTITION is not allowed for tables with GLOBAL INDEX
Problem Summary:
This was disabled, since Global index was not stable. Now when we are stabilizing Global index, this is a functionality blocker.
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.