Skip to content

Commit

Permalink
Revert "*: enlarge the default value of max-merge-region-size. (#8445
Browse files Browse the repository at this point in the history
…)" (#8541)

ref pingcap/tidb#55374

Revert the changes on the configuration of region-size. These changes will be delayed until v8.4.

Signed-off-by: lucasliang <[email protected]>
  • Loading branch information
LykxSassinator authored Aug 16, 2024
1 parent 248206b commit 8b35fcd
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 14 deletions.
4 changes: 2 additions & 2 deletions conf/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
11 changes: 4 additions & 7 deletions pkg/schedule/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 2 additions & 4 deletions tools/pd-ctl/tests/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
Expand Down
2 changes: 1 addition & 1 deletion tools/pd-ctl/tests/region/region_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 <start_key> <end_key> <limit> command
Expand Down

0 comments on commit 8b35fcd

Please sign in to comment.