Skip to content

Commit

Permalink
change the table level rule to cover the all the range with specified…
Browse files Browse the repository at this point in the history
… table id

Signed-off-by: ailinkid <314806019@qq.com>
  • Loading branch information
AilinKid committed Sep 23, 2021
1 parent de6fef3 commit 21bb88a
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 @@ -365,8 +365,9 @@ func (b *Bundle) Tidy() error {
// Reset resets the bundle ID and keyrange of all rules.
func (b *Bundle) Reset(newID int64) *Bundle {
b.ID = GroupID(newID)
startKey := hex.EncodeToString(codec.EncodeBytes(nil, tablecodec.GenTableRecordPrefix(newID)))
endKey := hex.EncodeToString(codec.EncodeBytes(nil, tablecodec.GenTableRecordPrefix(newID+1)))
// 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 b.Rules {
rule.GroupID = b.ID
rule.StartKeyHex = startKey
Expand Down

0 comments on commit 21bb88a

Please sign in to comment.