Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "*: enlarge the default value of max-merge-region-size. (#8445)" #8541

Merged
merged 1 commit into from
Aug 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
LykxSassinator marked this conversation as resolved.
Show resolved Hide resolved
## 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
Loading