Skip to content

Commit

Permalink
ddl: fix the create table with policy will cause the PD failure (ping…
Browse files Browse the repository at this point in the history
  • Loading branch information
AilinKid authored Oct 26, 2021
1 parent 3762608 commit 1995eae
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ddl/placement/bundle.go
Original file line number Diff line number Diff line change
Expand Up @@ -394,9 +394,10 @@ func (b *Bundle) Reset(ruleIndex int, newIDs []int64) *Bundle {
// Involve all the table level objects.
startKey := hex.EncodeToString(codec.EncodeBytes(nil, tablecodec.GenTablePrefix(newID)))
endKey := hex.EncodeToString(codec.EncodeBytes(nil, tablecodec.GenTablePrefix(newID+1)))
for _, rule := range basicRules {
for j, rule := range basicRules {
clone := rule.Clone()
clone.ID = ruleID
// for the rules of one element id, distinguishing the rule ids to avoid the PD's overlap.
clone.ID = ruleID + "_" + strconv.FormatInt(int64(j), 10)
clone.GroupID = b.ID
clone.StartKeyHex = startKey
clone.EndKeyHex = endKey
Expand Down

0 comments on commit 1995eae

Please sign in to comment.