From 3ec6a993babb70fd2d1db37ec567a82b8aa950de Mon Sep 17 00:00:00 2001 From: lucasliang Date: Fri, 16 Aug 2024 12:11:31 +0800 Subject: [PATCH] Revert "*: enlarge the default value of `max-merge-region-size`. (#8445)" This reverts commit aa85b6c0047b0f2af37c1bd271ee194af1c0dd56. Signed-off-by: lucasliang --- conf/config.toml | 4 ++-- pkg/schedule/config/config.go | 11 ++++------- tools/pd-ctl/tests/config/config_test.go | 6 ++---- tools/pd-ctl/tests/region/region_test.go | 2 +- 4 files changed, 9 insertions(+), 14 deletions(-) diff --git a/conf/config.toml b/conf/config.toml index 0c4acf5fd8c..438d2c857a5 100644 --- a/conf/config.toml +++ b/conf/config.toml @@ -111,9 +111,9 @@ [schedule] ## Controls the size limit of Region Merge. -# max-merge-region-size = 54 +# max-merge-region-size = 20 ## Specifies the upper limit of the Region Merge key. -# max-merge-region-keys = 540000 +# max-merge-region-keys = 200000 ## Controls the time interval between the split and merge operations on the same Region. # split-merge-interval = "1h" ## When PD fails to receive the heartbeat from a store after the specified period of time, diff --git a/pkg/schedule/config/config.go b/pkg/schedule/config/config.go index 124bff0a704..9074fce8fb8 100644 --- a/pkg/schedule/config/config.go +++ b/pkg/schedule/config/config.go @@ -28,13 +28,10 @@ import ( const ( // DefaultMaxReplicas is the default number of replicas for each region. - DefaultMaxReplicas = 3 - defaultMaxSnapshotCount = 64 - defaultMaxPendingPeerCount = 64 - // defaultMaxMergeRegionSize is the default maximum size of region when regions can be merged. - // After https://github.com/tikv/tikv/issues/17309, the default value is enlarged from 20 to 54, - // to make it compatible with the default value of region size of tikv. - defaultMaxMergeRegionSize = 54 + DefaultMaxReplicas = 3 + defaultMaxSnapshotCount = 64 + defaultMaxPendingPeerCount = 64 + defaultMaxMergeRegionSize = 20 defaultLeaderScheduleLimit = 4 defaultRegionScheduleLimit = 2048 defaultWitnessScheduleLimit = 4 diff --git a/tools/pd-ctl/tests/config/config_test.go b/tools/pd-ctl/tests/config/config_test.go index 0404796a81e..ad91e759fa8 100644 --- a/tools/pd-ctl/tests/config/config_test.go +++ b/tools/pd-ctl/tests/config/config_test.go @@ -180,11 +180,9 @@ func (suite *configTestSuite) checkConfig(cluster *pdTests.TestCluster) { scheduleConfig.MaxMergeRegionKeys = scheduleConfig.GetMaxMergeRegionKeys() re.Equal(scheduleConfig, &scheduleCfg) - // After https://github.com/tikv/tikv/issues/17309, the default value is enlarged from 20 to 54, - // to make it compatible with the default value of region size of tikv. - re.Equal(54, int(svr.GetScheduleConfig().MaxMergeRegionSize)) + re.Equal(20, int(svr.GetScheduleConfig().MaxMergeRegionSize)) re.Equal(0, int(svr.GetScheduleConfig().MaxMergeRegionKeys)) - re.Equal(54*10000, int(svr.GetScheduleConfig().GetMaxMergeRegionKeys())) + re.Equal(20*10000, int(svr.GetScheduleConfig().GetMaxMergeRegionKeys())) // set max-merge-region-size to 40MB args = []string{"-u", pdAddr, "config", "set", "max-merge-region-size", "40"} diff --git a/tools/pd-ctl/tests/region/region_test.go b/tools/pd-ctl/tests/region/region_test.go index 49f1eaa0a58..afffba411bc 100644 --- a/tools/pd-ctl/tests/region/region_test.go +++ b/tools/pd-ctl/tests/region/region_test.go @@ -142,7 +142,7 @@ func TestRegion(t *testing.T) { // region check empty-region command {[]string{"region", "check", "empty-region"}, []*core.RegionInfo{r1}}, // region check undersized-region command - {[]string{"region", "check", "undersized-region"}, []*core.RegionInfo{r1, r3, r4}}, + {[]string{"region", "check", "undersized-region"}, []*core.RegionInfo{r1, r4}}, // region check oversized-region command {[]string{"region", "check", "oversized-region"}, []*core.RegionInfo{r2}}, // region keys --format=raw command