From 4ab4c1f94609d03eccf10c72ceecd1469ea09794 Mon Sep 17 00:00:00 2001 From: buffer <1045931706@qq.com> Date: Thu, 13 Jul 2023 14:08:14 +0800 Subject: [PATCH] config: enable merge operator in raftstore-v2 (#6791) close tikv/pd#6167 Signed-off-by: bufferflies <1045931706@qq.com> Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com> --- server/api/hot_status.go | 2 +- server/cluster/cluster_test.go | 1 - server/config/persist_options.go | 8 +------- tests/pdctl/hot/hot_test.go | 7 +++++++ 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/server/api/hot_status.go b/server/api/hot_status.go index 0296155596b..749a371300a 100644 --- a/server/api/hot_status.go +++ b/server/api/hot_status.go @@ -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)) diff --git a/server/cluster/cluster_test.go b/server/cluster/cluster_test.go index 35e2ba9fa9a..7bb24d79cf1 100644 --- a/server/cluster/cluster_test.go +++ b/server/cluster/cluster_test.go @@ -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) diff --git a/server/config/persist_options.go b/server/config/persist_options.go index 81484e12607..8d6d1b6b6bc 100644 --- a/server/config/persist_options.go +++ b/server/config/persist_options.go @@ -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" diff --git a/tests/pdctl/hot/hot_test.go b/tests/pdctl/hot/hot_test.go index 4e926687223..2dfa89acb52 100644 --- a/tests/pdctl/hot/hot_test.go +++ b/tests/pdctl/hot/hot_test.go @@ -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) {