diff --git a/server/cluster/cluster.go b/server/cluster/cluster.go index 0e14adf3402..46a525a3e09 100644 --- a/server/cluster/cluster.go +++ b/server/cluster/cluster.go @@ -114,6 +114,9 @@ const ( heartbeatTaskRunner = "heartbeat-async" miscTaskRunner = "misc-async" logTaskRunner = "log-async" + + // TODO: make it configurable + IsTSODynamicSwitchingEnabled = false ) // Server is the interface for cluster. @@ -409,7 +412,7 @@ func (c *RaftCluster) checkSchedulingService() { // checkTSOService checks the TSO service. func (c *RaftCluster) checkTSOService() { if c.isAPIServiceMode { - if c.opt.GetMicroServiceConfig().IsTSODynamicSwitchingEnabled() { + if IsTSODynamicSwitchingEnabled { servers, err := discovery.Discover(c.etcdClient, constant.TSOServiceName) if err != nil || len(servers) == 0 { if err := c.startTSOJobsIfNeeded(); err != nil { diff --git a/server/config/config.go b/server/config/config.go index 36126572099..c64ee3831b0 100644 --- a/server/config/config.go +++ b/server/config/config.go @@ -874,12 +874,6 @@ func (c *MicroServiceConfig) IsSchedulingFallbackEnabled() bool { return c.EnableSchedulingFallback } -// IsTSODynamicSwitchingEnabled returns whether to enable TSO dynamic switching. -func (*MicroServiceConfig) IsTSODynamicSwitchingEnabled() bool { - // TODO: make it configurable - return false -} - // KeyspaceConfig is the configuration for keyspace management. type KeyspaceConfig struct { // PreAlloc contains the keyspace to be allocated during keyspace manager initialization. diff --git a/server/server.go b/server/server.go index 029c85694c3..c88871658dc 100644 --- a/server/server.go +++ b/server/server.go @@ -1411,7 +1411,7 @@ func (s *Server) GetRaftCluster() *cluster.RaftCluster { // IsServiceIndependent returns whether the service is independent. func (s *Server) IsServiceIndependent(name string) bool { if s.mode == APIServiceMode && !s.IsClosed() { - if name == constant.TSOServiceName && !s.GetMicroServiceConfig().IsTSODynamicSwitchingEnabled() { + if name == constant.TSOServiceName && !cluster.IsTSODynamicSwitchingEnabled { return true } return s.cluster.IsServiceIndependent(name)