Skip to content

Commit

Permalink
ddl: better comment
Browse files Browse the repository at this point in the history
Signed-off-by: xhe <xw897002528@gmail.com>
  • Loading branch information
xhebox committed May 18, 2021
1 parent 79fb48c commit 3354e2e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ddl/placement/bundle.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,10 @@ func (b *Bundle) Tidy() error {
if err != nil {
return err
}
// added -engine=tiflash, and it is the only constraint
// Constraints.Add() will automatically avoid duplication
// if -engine=tiflash is added and there is only one constraint
// then it must be -engine=tiflash
// it is seen as an empty constraint, so merge it
if len(rule.Constraints) == 1 {
extraCnt[rule.Role] += rule.Count
continue
Expand All @@ -152,7 +155,7 @@ func (b *Bundle) Tidy() error {
newRules = append(newRules, rule)
}
for role, cnt := range extraCnt {
// refer to tidb#22065.
// add -engine=tiflash, refer to tidb#22065.
newRules = append(newRules, &Rule{
ID: string(role),
Role: role,
Expand Down

0 comments on commit 3354e2e

Please sign in to comment.