Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
Signed-off-by: lhy1024 <admin@liudos.us>
  • Loading branch information
lhy1024 committed Dec 17, 2024
1 parent 130d12f commit 45dee91
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pkg/schedule/config/store_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ func (c *StoreConfig) CheckRegionSize(size, mergeSize uint64) error {
if regionSplitSize == 0 {
return nil
}
// the smallest of the split regions can not be merge again, so it's size should less merge size.
// the smallest of the split regions can not be merge again, so it's size should be less than merge size.
if smallSize := size % regionSplitSize; smallSize <= mergeSize && smallSize != 0 {
log.Debug("region size is too small", zap.Uint64("size", size), zap.Uint64("merge-size", mergeSize), zap.Uint64("small-size", smallSize))
return errs.ErrCheckerMergeAgain.FastGenByArgs("the smallest region of the split regions is less than max-merge-region-size, " +
Expand Down
4 changes: 2 additions & 2 deletions tools/pd-ctl/pdctl/command/store_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ func storeLimitCommandFunc(cmd *cobra.Command, args []string) {
if args[0] == "all" {
prefix = storesLimitPrefix
if rate > maxStoreLimit {
cmd.Printf("rate should less than %v for all\n", int(maxStoreLimit))
cmd.Printf("rate should be less than %.1f for all\n", maxStoreLimit)
return
}
} else {
Expand Down Expand Up @@ -594,7 +594,7 @@ func storeLimitCommandFunc(cmd *cobra.Command, args []string) {
return
}
if rate > maxStoreLimit {
cmd.Printf("rate should less than %v for all\n", int(maxStoreLimit))
cmd.Printf("rate should be less than %.1f for all\n", maxStoreLimit)

Check warning on line 597 in tools/pd-ctl/pdctl/command/store_command.go

View check run for this annotation

Codecov / codecov/patch

tools/pd-ctl/pdctl/command/store_command.go#L597

Added line #L597 was not covered by tests
return
}
postInput["rate"] = rate
Expand Down
4 changes: 2 additions & 2 deletions tools/pd-ctl/tests/store/store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -482,13 +482,13 @@ func TestStore(t *testing.T) {
args = []string{"-u", pdAddr, "store", "limit", "all", "201"}
output, err = tests.ExecuteCommand(cmd, args...)
re.NoError(err)
re.Contains(string(output), "rate should less than")
re.Contains(string(output), "rate should be less than")

// store limit all 201 is invalid for label
args = []string{"-u", pdAddr, "store", "limit", "all", "engine", "key", "201", "add-peer"}
output, err = tests.ExecuteCommand(cmd, args...)
re.NoError(err)
re.Contains(string(output), "rate should less than")
re.Contains(string(output), "rate should be less than")
}

// https://github.com/tikv/pd/issues/5024
Expand Down

0 comments on commit 45dee91

Please sign in to comment.