Skip to content

Commit

Permalink
Merge branch 'master' into pd-ctl3
Browse files Browse the repository at this point in the history
  • Loading branch information
ti-chi-bot[bot] authored Jul 13, 2023
2 parents 85c7da6 + 4ab4c1f commit 0e4d25d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion server/api/hot_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ func (h *hotStatusHandler) GetHotBuckets(w http.ResponseWriter, r *http.Request)
ids[i] = id
}
}
stats := h.Handler.GetHotBuckets()
stats := h.Handler.GetHotBuckets(ids...)
ret := HotBucketsResponse{}
for regionID, stats := range stats {
ret[regionID] = make([]*HotBucketsItem, len(stats))
Expand Down
1 change: 0 additions & 1 deletion server/cluster/cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1348,7 +1348,6 @@ func TestSyncConfig(t *testing.T) {
if v.updated {
re.True(switchRaftV2)
tc.opt.UseRaftV2()
re.EqualValues(0, tc.opt.GetMaxMergeRegionSize())
re.EqualValues(512, tc.opt.GetMaxMovableHotPeerSize())
success, switchRaftV2 = syncConfig(tc.storeConfigManager, tc.GetStores())
re.True(success)
Expand Down
8 changes: 1 addition & 7 deletions server/config/persist_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,13 +202,7 @@ func (o *PersistOptions) SetMaxReplicas(replicas int) {
}

// UseRaftV2 set some config for raft store v2 by default temporary.
// todo: remove this after raft store support this.
// disable merge check
func (o *PersistOptions) UseRaftV2() {
v := o.GetScheduleConfig().Clone()
v.MaxMergeRegionSize = 0
o.SetScheduleConfig(v)
}
func (o *PersistOptions) UseRaftV2() {}

const (
maxSnapshotCountKey = "schedule.max-snapshot-count"
Expand Down
7 changes: 7 additions & 0 deletions tests/pdctl/hot/hot_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,13 @@ func TestHotWithStoreID(t *testing.T) {
re.Equal(buckets.GetStats().ReadKeys[0]/interval, item.ReadKeys)
re.Equal(buckets.GetStats().WriteBytes[0]/interval, item.WriteBytes)
re.Equal(buckets.GetStats().WriteKeys[0]/interval, item.WriteKeys)

args = []string{"-u", pdAddr, "hot", "buckets", "2"}
output, err = pdctl.ExecuteCommand(cmd, args...)
re.NoError(err)
hotBuckets = api.HotBucketsResponse{}
re.NoError(json.Unmarshal(output, &hotBuckets))
re.Nil(hotBuckets[2])
}

func TestHistoryHotRegions(t *testing.T) {
Expand Down

0 comments on commit 0e4d25d

Please sign in to comment.