diff --git a/go/cmd/dolt/commands/sqlserver/command_line_config.go b/go/cmd/dolt/commands/sqlserver/command_line_config.go index 55ba982cd4a..6c05e48744e 100755 --- a/go/cmd/dolt/commands/sqlserver/command_line_config.go +++ b/go/cmd/dolt/commands/sqlserver/command_line_config.go @@ -41,7 +41,6 @@ type commandLineServerConfig struct { autoCommit bool doltTransactionCommit bool maxConnections uint64 - queryParallelism int tlsKey string tlsCert string requireSecureTransport bool @@ -71,7 +70,6 @@ func DefaultCommandLineServerConfig() *commandLineServerConfig { logLevel: servercfg.DefaultLogLevel, autoCommit: servercfg.DefaultAutoCommit, maxConnections: servercfg.DefaultMaxConnections, - queryParallelism: servercfg.DefaultQueryParallelism, dataDir: servercfg.DefaultDataDir, cfgDir: filepath.Join(servercfg.DefaultDataDir, servercfg.DefaultCfgDir), privilegeFilePath: filepath.Join(servercfg.DefaultDataDir, servercfg.DefaultCfgDir, servercfg.DefaultPrivilegeFilePath), @@ -150,10 +148,6 @@ func NewCommandLineConfig(creds *cli.UserPassword, apr *argparser.ArgParseResult config.withDataDir(dataDir) } - if queryParallelism, ok := apr.GetInt(queryParallelismFlag); ok { - config.withQueryParallelism(queryParallelism) - } - if maxConnections, ok := apr.GetInt(maxConnectionsFlag); ok { config.withMaxConnections(uint64(maxConnections)) } @@ -230,11 +224,6 @@ func (cfg *commandLineServerConfig) MaxConnections() uint64 { return cfg.maxConnections } -// QueryParallelism returns the parallelism that should be used by the go-mysql-server analyzer -func (cfg *commandLineServerConfig) QueryParallelism() int { - return cfg.queryParallelism -} - // TLSKey returns a path to the servers PEM-encoded private TLS key. "" if there is none. func (cfg *commandLineServerConfig) TLSKey() string { return cfg.tlsKey @@ -391,12 +380,6 @@ func (cfg *commandLineServerConfig) withMaxConnections(maxConnections uint64) *c return cfg } -// withQueryParallelism updates the query parallelism and returns the called `*commandLineServerConfig`, which is useful for chaining calls. -func (cfg *commandLineServerConfig) withQueryParallelism(queryParallelism int) *commandLineServerConfig { - cfg.queryParallelism = queryParallelism - return cfg -} - // withDataDir updates the path to a directory to use as the data dir. func (cfg *commandLineServerConfig) withDataDir(dataDir string) *commandLineServerConfig { cfg.dataDir = dataDir diff --git a/go/libraries/doltcore/servercfg/serverconfig.go b/go/libraries/doltcore/servercfg/serverconfig.go index e5fab15a1b3..725abfd14b3 100644 --- a/go/libraries/doltcore/servercfg/serverconfig.go +++ b/go/libraries/doltcore/servercfg/serverconfig.go @@ -50,7 +50,6 @@ const ( DefaultAutoCommit = true DefaultDoltTransactionCommit = false DefaultMaxConnections = 100 - DefaultQueryParallelism = 0 DefaultDataDir = "." DefaultCfgDir = ".doltcfg" DefaultPrivilegeFilePath = "privileges.db" @@ -147,8 +146,6 @@ type ServerConfig interface { CfgDir() string // MaxConnections returns the maximum number of simultaneous connections the server will allow. The default is 1 MaxConnections() uint64 - // QueryParallelism returns the parallelism that should be used by the go-mysql-server analyzer - QueryParallelism() int // TLSKey returns a path to the servers PEM-encoded private TLS key. "" if there is none. TLSKey() string // TLSCert returns a path to the servers PEM-encoded TLS certificate chain. "" if there is none. @@ -224,7 +221,6 @@ func DefaultServerConfig() ServerConfig { WriteTimeoutMillis: ptr(uint64(DefaultTimeout)), AllowCleartextPasswords: ptr(DefaultAllowCleartextPasswords), }, - PerformanceConfig: PerformanceYAMLConfig{QueryParallelism: ptr(DefaultQueryParallelism)}, DataDirStr: ptr(DefaultDataDir), CfgDirStr: ptr(filepath.Join(DefaultDataDir, DefaultCfgDir)), PrivilegeFile: ptr(filepath.Join(DefaultDataDir, DefaultCfgDir, DefaultPrivilegeFilePath)), diff --git a/go/libraries/doltcore/servercfg/testdata/minver_validation.txt b/go/libraries/doltcore/servercfg/testdata/minver_validation.txt index d55ffc3931c..dcf4d8d1202 100644 --- a/go/libraries/doltcore/servercfg/testdata/minver_validation.txt +++ b/go/libraries/doltcore/servercfg/testdata/minver_validation.txt @@ -25,8 +25,8 @@ ListenerConfig servercfg.ListenerYAMLConfig 0.0.0 listener -RequireSecureTransport *bool 0.0.0 require_secure_transport -AllowCleartextPasswords *bool 0.0.0 allow_cleartext_passwords -Socket *string 0.0.0 socket,omitempty -PerformanceConfig servercfg.PerformanceYAMLConfig 0.0.0 performance --QueryParallelism *int 0.0.0 query_parallelism +PerformanceConfig *servercfg.PerformanceYAMLConfig 0.0.0 performance,omitempty +-QueryParallelism *int 0.0.0 query_parallelism,omitempty DataDirStr *string 0.0.0 data_dir,omitempty CfgDirStr *string 0.0.0 cfg_dir,omitempty MetricsConfig servercfg.MetricsYAMLConfig 0.0.0 metrics diff --git a/go/libraries/doltcore/servercfg/yaml_config.go b/go/libraries/doltcore/servercfg/yaml_config.go index 48c6a0c54fe..1eeae402155 100644 --- a/go/libraries/doltcore/servercfg/yaml_config.go +++ b/go/libraries/doltcore/servercfg/yaml_config.go @@ -94,7 +94,8 @@ type ListenerYAMLConfig struct { // PerformanceYAMLConfig contains configuration parameters for performance tweaking type PerformanceYAMLConfig struct { - QueryParallelism *int `yaml:"query_parallelism"` + // QueryParallelism is deprecated but still present to prevent breaking YAML config that still uses it + QueryParallelism *int `yaml:"query_parallelism,omitempty"` } type MetricsYAMLConfig struct { @@ -123,20 +124,20 @@ type UserSessionVars struct { // YAMLConfig is a ServerConfig implementation which is read from a yaml file type YAMLConfig struct { - LogLevelStr *string `yaml:"log_level,omitempty"` - MaxQueryLenInLogs *int `yaml:"max_logged_query_len,omitempty"` - EncodeLoggedQuery *bool `yaml:"encode_logged_query,omitempty"` - BehaviorConfig BehaviorYAMLConfig `yaml:"behavior"` - UserConfig UserYAMLConfig `yaml:"user"` - ListenerConfig ListenerYAMLConfig `yaml:"listener"` - PerformanceConfig PerformanceYAMLConfig `yaml:"performance"` - DataDirStr *string `yaml:"data_dir,omitempty"` - CfgDirStr *string `yaml:"cfg_dir,omitempty"` - MetricsConfig MetricsYAMLConfig `yaml:"metrics"` - RemotesapiConfig RemotesapiYAMLConfig `yaml:"remotesapi"` - ClusterCfg *ClusterYAMLConfig `yaml:"cluster,omitempty"` - PrivilegeFile *string `yaml:"privilege_file,omitempty"` - BranchControlFile *string `yaml:"branch_control_file,omitempty"` + LogLevelStr *string `yaml:"log_level,omitempty"` + MaxQueryLenInLogs *int `yaml:"max_logged_query_len,omitempty"` + EncodeLoggedQuery *bool `yaml:"encode_logged_query,omitempty"` + BehaviorConfig BehaviorYAMLConfig `yaml:"behavior"` + UserConfig UserYAMLConfig `yaml:"user"` + ListenerConfig ListenerYAMLConfig `yaml:"listener"` + PerformanceConfig *PerformanceYAMLConfig `yaml:"performance,omitempty"` + DataDirStr *string `yaml:"data_dir,omitempty"` + CfgDirStr *string `yaml:"cfg_dir,omitempty"` + MetricsConfig MetricsYAMLConfig `yaml:"metrics"` + RemotesapiConfig RemotesapiYAMLConfig `yaml:"remotesapi"` + ClusterCfg *ClusterYAMLConfig `yaml:"cluster,omitempty"` + PrivilegeFile *string `yaml:"privilege_file,omitempty"` + BranchControlFile *string `yaml:"branch_control_file,omitempty"` // TODO: Rename to UserVars_ Vars []UserSessionVars `yaml:"user_session_vars"` SystemVars_ map[string]interface{} `yaml:"system_variables,omitempty" minver:"1.11.1"` @@ -202,9 +203,6 @@ func ServerConfigAsYAMLConfig(cfg ServerConfig) *YAMLConfig { AllowCleartextPasswords: nillableBoolPtr(cfg.AllowCleartextPasswords()), Socket: nillableStrPtr(cfg.Socket()), }, - PerformanceConfig: PerformanceYAMLConfig{ - QueryParallelism: nillableIntPtr(cfg.QueryParallelism()), - }, DataDirStr: ptr(cfg.DataDir()), CfgDirStr: ptr(cfg.CfgDir()), MetricsConfig: MetricsYAMLConfig{ @@ -475,15 +473,6 @@ func (cfg YAMLConfig) AllowCleartextPasswords() bool { return *cfg.ListenerConfig.AllowCleartextPasswords } -// QueryParallelism returns the parallelism that should be used by the go-mysql-server analyzer -func (cfg YAMLConfig) QueryParallelism() int { - if cfg.PerformanceConfig.QueryParallelism == nil { - return DefaultQueryParallelism - } - - return *cfg.PerformanceConfig.QueryParallelism -} - // TLSKey returns a path to the servers PEM-encoded private TLS key. "" if there is none. func (cfg YAMLConfig) TLSKey() string { if cfg.ListenerConfig.TLSKey == nil {