forked from pingcap/tidb
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ddl: support
ALTER PLACEMENT
clause (pingcap#19065)
* ddl: check count here * ddl: drop all rules that will be overrided * ddl: change ID format * ddl: local placement deifinition * ddl: support `ALTER PLACEMENT` clause * ddl: add test cases * ddl: fix ID format * ddl: copy comments too * ddl: allow ignore replicas with dict constraints * ddl: rename COUNT to REPLICAS * ddl: clone method for RuleOp * ddl: checkPlacementSpec => buildPlacementSpec * ddl: remove TODO It is possible to incrementally add replicas. Consider drop later. Let us support it correctly first. * ddl: ID format Datbase/schema ID is added back. A common prefix will improve the efficience of PD batch operation. Drop a whole db/table will only need one loop for rules. * ddl: move const/util to placement package * ddl: fix test * ddl: fix format error * ddl: error check fix * ddl: use an explicit condition flag * ddl: adapt parser changes * ddl: fix go.mod/simplify code path * ddl: go mod tidy * ddl: improve tests * ddl: return new rules instead of appending * ddl: return constraints instead of appending * ddl: fix test * ddl: one more test * ddl: remove rules rollback, meaningless * ddl: fix slice * ddl: add period to comments * Update ddl/ddl_api.go Co-authored-by: tangenta <[email protected]> * ddl: remove unused arguments * infosync: do not request PD if no ruleOperations * ddl: a new test suite Co-authored-by: tangenta <[email protected]> Co-authored-by: ti-srebot <[email protected]>
- Loading branch information
1 parent
2de3aed
commit a016061
Showing
11 changed files
with
751 additions
and
250 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// Copyright 2020 PingCAP, Inc. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
package placement | ||
|
||
// RuleDefaultGroupID is the default GroupID for all placement rules, to | ||
// indicate that it is from TiDB_DDL statements. | ||
const RuleDefaultGroupID = "TiDB_DDL" | ||
|
||
const ( | ||
// RuleIndexDefault is the default index for a rule, check Rule.Index. | ||
RuleIndexDefault int = iota | ||
// RuleIndexDatabase is the index for a rule of database. | ||
RuleIndexDatabase | ||
// RuleIndexTable is the index for a rule of table. | ||
RuleIndexTable | ||
// RuleIndexPartition is the index for a rule of partition. | ||
RuleIndexPartition | ||
// RuleIndexIndex is the index for a rule of index. | ||
RuleIndexIndex | ||
) |
Oops, something went wrong.