Skip to content

Commit

Permalink
store limit
Browse files Browse the repository at this point in the history
Signed-off-by: bufferflies <1045931706@qq.com>
  • Loading branch information
bufferflies committed Nov 30, 2022
1 parent 2faa8f7 commit 5b90096
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions server/config/store_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ var (
defaultRegionSplitSize = uint64(96)
// default bucket size is 96MB
defaultBucketSize = uint64(96)

defaultSnapMaxWriteBytesPerSecMB = uint64(100)
// default region max key is 144000
defaultRegionMaxKey = uint64(1440000)
// default region split key is 960000
Expand All @@ -48,11 +50,8 @@ var (
// generated by https://mholt.github.io/json-to-go/.
// nolint
type StoreConfig struct {
Coprocessor `json:"coprocessor"`
Server ServerConfig `json:"server"`
RegionMaxSizeMB uint64 `json:"_"`
RegionSplitSizeMB uint64 `json:"_"`
RegionBucketSizeMB uint64 `json:"_"`
Coprocessor `json:"coprocessor"`
ServerConfig `json:"server"`
}

type ServerConfig struct {
Expand All @@ -72,6 +71,9 @@ type Coprocessor struct {
RegionSplitKeys int `json:"region-split-keys"`
EnableRegionBucket bool `json:"enable-region-bucket"`
RegionBucketSize string `json:"region-bucket-size"`
RegionMaxSizeMB uint64 `json:"_"`
RegionSplitSizeMB uint64 `json:"_"`
RegionBucketSizeMB uint64 `json:"_"`
}

// Equal returns true if the two configs are equal.
Expand Down Expand Up @@ -216,8 +218,8 @@ func (m *StoreConfigManager) update(cfg *StoreConfig) {
cfg.RegionMaxSizeMB = typeutil.ParseMBFromText(cfg.RegionMaxSize, defaultRegionMaxSize)
cfg.RegionSplitSizeMB = typeutil.ParseMBFromText(cfg.RegionSplitSize, defaultRegionSplitSize)
cfg.RegionBucketSizeMB = typeutil.ParseMBFromText(cfg.RegionBucketSize, defaultBucketSize)
cfg.
m.config.Store(cfg)
cfg.SnapMaxWriteBytesPerSecMB = typeutil.ParseMBFromText(cfg.SnapMaxWriteBytesPerSec, defaultBucketSize)
m.config.Store(cfg)
}

// GetStoreConfig returns the current store configuration.
Expand Down

0 comments on commit 5b90096

Please sign in to comment.