-
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: supports non-unique global index #58678
ddl: supports non-unique global index #58678
Conversation
Hi @Defined2014. 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 #58678 +/- ##
================================================
+ Coverage 73.0940% 75.0823% +1.9882%
================================================
Files 1677 1723 +46
Lines 463715 482854 +19139
================================================
+ Hits 338948 362538 +23590
+ Misses 103902 97445 -6457
- Partials 20865 22871 +2006
Flags with carried forward coverage won't be shown. Click here to find out more.
|
91cef4a
to
f5aa86b
Compare
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, only missing some tests for ALTER TABLE t PARTITION BY ... UPDATE INDEXES (...)
create table t (a int, b int, unique key (a)) partition by hash(a) partitions 3; | ||
-- error 8264 | ||
alter table t partition by hash(b) partitions 3; | ||
alter table t partition by hash(b) partitions 3 update indexes (a global); | ||
-- error 8200 | ||
alter table t add index idxErr (b) global; | ||
alter table t add unique index idxOK (b) global; | ||
-- error 8200 | ||
create index idxErr on t (b) global; | ||
create unique index idxOK2 on t (b) global; | ||
alter table t remove partitioning; | ||
-- error 8200 | ||
alter table t add index idxErr (b) global; | ||
-- error 8200 | ||
alter table t add unique index idxErr (b) global; | ||
-- error 8200 | ||
create index idxErr on t (b) global; | ||
-- error 8200 | ||
create unique index idxErr on t (b) global; | ||
drop table t; | ||
|
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 remove all of these? The added ones below does not include repartitioning, alter table t partition by hash(b) partitions 3 update indexes (a global);
for example.
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.
I think they are duplicate with L58-L79
create index idxOK4 on t (b) global; | ||
create unique index idxOK5 on t (a) global; | ||
create unique index idxOK6 on t (b) global; | ||
|
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.
Could you please also add tests for repartitioning a table, where one can switch between GLOBAL and NON-GLOBAL non-unique index? Like:
alter table t partition by key(b) partitions 5 UPDATE INDEXES (idxOK LOCAL, idxOK2 GLOBAL, idxOK3 LOCAL);
Ideally so that non-unique indexes will test local->local, local->global, global->local and nglobal->global (both implicitly and explicitly, where possible)
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
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mjonss, 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 |
/unhold |
…long-vector * commit '510d0037b18f258f505abc6cf13a8128563e9359': *: upgrade pd client to make sure tso client initiate successfully (#58752) ttl, test: scale TTL workers during the fault tests (#58750) planner: improve warning messages for unsupported HASH_JOIN hints (#58646) planner: prealloc the slices in the SplitCorColAccessCondFromFilters (#58785) ddl: supports non-unique global index (#58678) util/stmtsummary: add the network traffic related fields (#58101) var: enable `pd_enable_follower_handle_region` as default (#58385) statistics: refactor stats meta handling to use DeltaUpdate for multi-table support (#58657) parser: move 'model' to 'ast' pkg (#58704) statistics: add recover to protect background task (#58739) disttask: cancel subtask context if scheduled away (#58615) *: don't handle live updates of column size (#58596) *: fix a bug for default_authentication_plugin (2) (#58723) dupdetect: gRPC cancel should trigger retry (#58542) *: fix a bug for default_authentication_plugin (#57391) distsql: Fix backoff execution info inaccurate issue (#58707)
What problem does this PR solve?
Issue Number: close #58650
Problem Summary: Supports non-unqiue global index. Not found bugs right now, we will add more test cases later.
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.