Skip to content

Commit

Permalink
use an individual PR to add config
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Leung <rleungx@gmail.com>
  • Loading branch information
rleungx committed Oct 28, 2024
1 parent 57e3218 commit 91ccdec
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions server/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,7 @@ const (
minCheckRegionSplitInterval = 1 * time.Millisecond
maxCheckRegionSplitInterval = 100 * time.Millisecond

defaultEnableSchedulingFallback = true
defaultEnableTSODynamicSwitching = false
defaultEnableSchedulingFallback = true
)

// Special keys for Labels
Expand Down Expand Up @@ -855,17 +854,13 @@ func (c *DRAutoSyncReplicationConfig) adjust(meta *configutil.ConfigMetaData) {

// MicroServiceConfig is the configuration for micro service.
type MicroServiceConfig struct {
EnableSchedulingFallback bool `toml:"enable-scheduling-fallback" json:"enable-scheduling-fallback,string"`
EnableTSODynamicSwitching bool `toml:"enable-tso-dynamic-switching" json:"enable-tso-dynamic-switching,string"`
EnableSchedulingFallback bool `toml:"enable-scheduling-fallback" json:"enable-scheduling-fallback,string"`
}

func (c *MicroServiceConfig) adjust(meta *configutil.ConfigMetaData) {
if !meta.IsDefined("enable-scheduling-fallback") {
c.EnableSchedulingFallback = defaultEnableSchedulingFallback
}
if !meta.IsDefined("enable-dynamic-tso") {
c.EnableTSODynamicSwitching = defaultEnableTSODynamicSwitching
}
}

// Clone returns a copy of micro service config.
Expand All @@ -880,8 +875,9 @@ func (c *MicroServiceConfig) IsSchedulingFallbackEnabled() bool {
}

// IsTSODynamicSwitchingEnabled returns whether to enable TSO dynamic switching.
func (c *MicroServiceConfig) IsTSODynamicSwitchingEnabled() bool {
return c.EnableTSODynamicSwitching
func (*MicroServiceConfig) IsTSODynamicSwitchingEnabled() bool {
// TODO: make it configurable
return false
}

// KeyspaceConfig is the configuration for keyspace management.
Expand Down

0 comments on commit 91ccdec

Please sign in to comment.