diff --git a/config/tablet/default.yaml b/config/tablet/default.yaml index f996bb04737..ec9d1f94833 100644 --- a/config/tablet/default.yaml +++ b/config/tablet/default.yaml @@ -57,21 +57,18 @@ oltpReadPool: idleTimeoutSeconds: 1800 # queryserver-config-idle-timeout maxLifetimeSeconds: 0 # queryserver-config-pool-conn-max-lifetime prefillParallelism: 0 # queryserver-config-pool-prefill-parallelism - maxWaiters: 50000 # queryserver-config-query-pool-waiter-cap olapReadPool: size: 200 # queryserver-config-stream-pool-size timeoutSeconds: 0 # queryserver-config-query-pool-timeout idleTimeoutSeconds: 1800 # queryserver-config-idle-timeout prefillParallelism: 0 # queryserver-config-stream-pool-prefill-parallelism - maxWaiters: 0 txPool: size: 20 # queryserver-config-transaction-cap timeoutSeconds: 1 # queryserver-config-txpool-timeout idleTimeoutSeconds: 1800 # queryserver-config-idle-timeout prefillParallelism: 0 # queryserver-config-transaction-prefill-parallelism - maxWaiters: 50000 # queryserver-config-txpool-waiter-cap oltp: queryTimeoutSeconds: 30 # queryserver-config-query-timeout diff --git a/doc/design-docs/TabletServerParamsAsYAML.md b/doc/design-docs/TabletServerParamsAsYAML.md index 49d073d1313..52d48a5e6f6 100644 --- a/doc/design-docs/TabletServerParamsAsYAML.md +++ b/doc/design-docs/TabletServerParamsAsYAML.md @@ -95,21 +95,18 @@ oltpReadPool: timeoutSeconds: 0 # queryserver-config-query-pool-timeout idleTimeoutSeconds: 1800 # queryserver-config-idle-timeout prefillParallelism: 0 # queryserver-config-pool-prefill-parallelism - maxWaiters: 50000 # queryserver-config-query-pool-waiter-cap olapReadPool: size: 200 # queryserver-config-stream-pool-size timeoutSeconds: 0 # queryserver-config-query-pool-timeout idleTimeoutSeconds: 1800 # queryserver-config-idle-timeout prefillParallelism: 0 # queryserver-config-stream-pool-prefill-parallelism - maxWaiters: 0 txPool: size: 20 # queryserver-config-transaction-cap timeoutSeconds: 1 # queryserver-config-txpool-timeout idleTimeoutSeconds: 1800 # queryserver-config-idle-timeout prefillParallelism: 0 # queryserver-config-transaction-prefill-parallelism - maxWaiters: 50000 # queryserver-config-txpool-waiter-cap oltp: queryTimeoutSeconds: 30 # queryserver-config-query-timeout diff --git a/go/flags/endtoend/vtcombo.txt b/go/flags/endtoend/vtcombo.txt index 59dd8969880..0843ee46563 100644 --- a/go/flags/endtoend/vtcombo.txt +++ b/go/flags/endtoend/vtcombo.txt @@ -283,21 +283,18 @@ Flags: --queryserver-config-pool-size int query server read pool size, connection pool is used by regular queries (non streaming, not in a transaction) (default 16) --queryserver-config-query-cache-memory int query server query cache size in bytes, maximum amount of memory to be used for caching. vttablet analyzes every incoming query and generate a query plan, these plans are being cached in a lru cache. This config controls the capacity of the lru cache. (default 33554432) --queryserver-config-query-pool-timeout duration query server query pool timeout, it is how long vttablet waits for a connection from the query pool. If set to 0 (default) then the overall query timeout is used instead. - --queryserver-config-query-pool-waiter-cap int query server query pool waiter limit, this is the maximum number of queries that can be queued waiting to get a connection (default 5000) --queryserver-config-query-timeout duration query server query timeout, this is the query timeout in vttablet side. If a query takes more than this timeout, it will be killed. (default 30s) --queryserver-config-schema-change-signal query server schema signal, will signal connected vtgates that schema has changed whenever this is detected. VTGates will need to have -schema_change_signal enabled for this to work (default true) --queryserver-config-schema-reload-time duration query server schema reload time, how often vttablet reloads schemas from underlying MySQL instance. vttablet keeps table schemas in its own memory and periodically refreshes it from MySQL. This config controls the reload time. (default 30m0s) --queryserver-config-stream-buffer-size int query server stream buffer size, the maximum number of bytes sent from vttablet for each stream call. It's recommended to keep this value in sync with vtgate's stream_buffer_size. (default 32768) --queryserver-config-stream-pool-size int query server stream connection pool size, stream pool is used by stream queries: queries that return results to client in a streaming fashion (default 200) --queryserver-config-stream-pool-timeout duration query server stream pool timeout, it is how long vttablet waits for a connection from the stream pool. If set to 0 (default) then there is no timeout. - --queryserver-config-stream-pool-waiter-cap int query server stream pool waiter limit, this is the maximum number of streaming queries that can be queued waiting to get a connection --queryserver-config-strict-table-acl only allow queries that pass table acl checks --queryserver-config-terse-errors prevent bind vars from escaping in client error messages --queryserver-config-transaction-cap int query server transaction cap is the maximum number of transactions allowed to happen at any given point of a time for a single vttablet. E.g. by setting transaction cap to 100, there are at most 100 transactions will be processed by a vttablet and the 101th transaction will be blocked (and fail if it cannot get connection within specified timeout) (default 20) --queryserver-config-transaction-timeout duration query server transaction timeout, a transaction will be killed if it takes longer than this value (default 30s) --queryserver-config-truncate-error-len int truncate errors sent to client if they are longer than this value (0 means do not truncate) --queryserver-config-txpool-timeout duration query server transaction pool timeout, it is how long vttablet waits if tx pool is full (default 1s) - --queryserver-config-txpool-waiter-cap int query server transaction pool waiter limit, this is the maximum number of transactions that can be queued waiting to get a connection (default 5000) --queryserver-config-warn-result-size int query server result size warning threshold, warn if number of rows returned from vttablet for non-streaming queries exceeds this --queryserver-enable-settings-pool Enable pooling of connections with modified system settings (default true) --queryserver-enable-views Enable views support in vttablet. diff --git a/go/flags/endtoend/vttablet.txt b/go/flags/endtoend/vttablet.txt index ac25179db9b..bb7403ef1cb 100644 --- a/go/flags/endtoend/vttablet.txt +++ b/go/flags/endtoend/vttablet.txt @@ -276,21 +276,18 @@ Flags: --queryserver-config-pool-size int query server read pool size, connection pool is used by regular queries (non streaming, not in a transaction) (default 16) --queryserver-config-query-cache-memory int query server query cache size in bytes, maximum amount of memory to be used for caching. vttablet analyzes every incoming query and generate a query plan, these plans are being cached in a lru cache. This config controls the capacity of the lru cache. (default 33554432) --queryserver-config-query-pool-timeout duration query server query pool timeout, it is how long vttablet waits for a connection from the query pool. If set to 0 (default) then the overall query timeout is used instead. - --queryserver-config-query-pool-waiter-cap int query server query pool waiter limit, this is the maximum number of queries that can be queued waiting to get a connection (default 5000) --queryserver-config-query-timeout duration query server query timeout, this is the query timeout in vttablet side. If a query takes more than this timeout, it will be killed. (default 30s) --queryserver-config-schema-change-signal query server schema signal, will signal connected vtgates that schema has changed whenever this is detected. VTGates will need to have -schema_change_signal enabled for this to work (default true) --queryserver-config-schema-reload-time duration query server schema reload time, how often vttablet reloads schemas from underlying MySQL instance. vttablet keeps table schemas in its own memory and periodically refreshes it from MySQL. This config controls the reload time. (default 30m0s) --queryserver-config-stream-buffer-size int query server stream buffer size, the maximum number of bytes sent from vttablet for each stream call. It's recommended to keep this value in sync with vtgate's stream_buffer_size. (default 32768) --queryserver-config-stream-pool-size int query server stream connection pool size, stream pool is used by stream queries: queries that return results to client in a streaming fashion (default 200) --queryserver-config-stream-pool-timeout duration query server stream pool timeout, it is how long vttablet waits for a connection from the stream pool. If set to 0 (default) then there is no timeout. - --queryserver-config-stream-pool-waiter-cap int query server stream pool waiter limit, this is the maximum number of streaming queries that can be queued waiting to get a connection --queryserver-config-strict-table-acl only allow queries that pass table acl checks --queryserver-config-terse-errors prevent bind vars from escaping in client error messages --queryserver-config-transaction-cap int query server transaction cap is the maximum number of transactions allowed to happen at any given point of a time for a single vttablet. E.g. by setting transaction cap to 100, there are at most 100 transactions will be processed by a vttablet and the 101th transaction will be blocked (and fail if it cannot get connection within specified timeout) (default 20) --queryserver-config-transaction-timeout duration query server transaction timeout, a transaction will be killed if it takes longer than this value (default 30s) --queryserver-config-truncate-error-len int truncate errors sent to client if they are longer than this value (0 means do not truncate) --queryserver-config-txpool-timeout duration query server transaction pool timeout, it is how long vttablet waits if tx pool is full (default 1s) - --queryserver-config-txpool-waiter-cap int query server transaction pool waiter limit, this is the maximum number of transactions that can be queued waiting to get a connection (default 5000) --queryserver-config-warn-result-size int query server result size warning threshold, warn if number of rows returned from vttablet for non-streaming queries exceeds this --queryserver-enable-settings-pool Enable pooling of connections with modified system settings (default true) --queryserver-enable-views Enable views support in vttablet. diff --git a/go/vt/vttablet/tabletserver/tabletenv/config.go b/go/vt/vttablet/tabletserver/tabletenv/config.go index 25352aba91b..233f8951227 100644 --- a/go/vt/vttablet/tabletserver/tabletenv/config.go +++ b/go/vt/vttablet/tabletserver/tabletenv/config.go @@ -142,9 +142,15 @@ func registerTabletEnvFlags(fs *pflag.FlagSet) { fs.DurationVar(¤tConfig.TxPool.Timeout, "queryserver-config-txpool-timeout", defaultConfig.TxPool.Timeout, "query server transaction pool timeout, it is how long vttablet waits if tx pool is full") fs.DurationVar(¤tConfig.OltpReadPool.IdleTimeout, "queryserver-config-idle-timeout", defaultConfig.OltpReadPool.IdleTimeout, "query server idle timeout, vttablet manages various mysql connection pools. This config means if a connection has not been used in given idle timeout, this connection will be removed from pool. This effectively manages number of connection objects and optimize the pool performance.") fs.DurationVar(¤tConfig.OltpReadPool.MaxLifetime, "queryserver-config-pool-conn-max-lifetime", defaultConfig.OltpReadPool.MaxLifetime, "query server connection max lifetime, vttablet manages various mysql connection pools. This config means if a connection has lived at least this long, it connection will be removed from pool upon the next time it is returned to the pool.") - fs.IntVar(¤tConfig.OltpReadPool.MaxWaiters, "queryserver-config-query-pool-waiter-cap", defaultConfig.OltpReadPool.MaxWaiters, "query server query pool waiter limit, this is the maximum number of queries that can be queued waiting to get a connection") - fs.IntVar(¤tConfig.OlapReadPool.MaxWaiters, "queryserver-config-stream-pool-waiter-cap", defaultConfig.OlapReadPool.MaxWaiters, "query server stream pool waiter limit, this is the maximum number of streaming queries that can be queued waiting to get a connection") - fs.IntVar(¤tConfig.TxPool.MaxWaiters, "queryserver-config-txpool-waiter-cap", defaultConfig.TxPool.MaxWaiters, "query server transaction pool waiter limit, this is the maximum number of transactions that can be queued waiting to get a connection") + + var unused int + fs.IntVar(&unused, "queryserver-config-query-pool-waiter-cap", 0, "query server query pool waiter limit, this is the maximum number of queries that can be queued waiting to get a connection") + fs.IntVar(&unused, "queryserver-config-stream-pool-waiter-cap", 0, "query server stream pool waiter limit, this is the maximum number of streaming queries that can be queued waiting to get a connection") + fs.IntVar(&unused, "queryserver-config-txpool-waiter-cap", 0, "query server transaction pool waiter limit, this is the maximum number of transactions that can be queued waiting to get a connection") + fs.MarkDeprecated("queryserver-config-query-pool-waiter-cap", "The new connection pool in v19 does not limit waiter capacity. This flag will be removed in a future release.") + fs.MarkDeprecated("queryserver-config-stream-pool-waiter-cap", "The new connection pool in v19 does not limit waiter capacity. This flag will be removed in a future release.") + fs.MarkDeprecated("queryserver-config-txpool-waiter-cap", "The new connection pool in v19 does not limit waiter capacity. This flag will be removed in a future release.") + // tableacl related configurations. fs.BoolVar(¤tConfig.StrictTableACL, "queryserver-config-strict-table-acl", defaultConfig.StrictTableACL, "only allow queries that pass table acl checks") fs.BoolVar(¤tConfig.EnableTableACLDryRun, "queryserver-config-enable-table-acl-dry-run", defaultConfig.EnableTableACLDryRun, "If this flag is enabled, tabletserver will emit monitoring metrics and let the request pass regardless of table acl check results") @@ -440,7 +446,6 @@ type ConnPoolConfig struct { IdleTimeout time.Duration `json:"idleTimeoutSeconds,omitempty"` MaxLifetime time.Duration `json:"maxLifetimeSeconds,omitempty"` PrefillParallelism int `json:"prefillParallelism,omitempty"` - MaxWaiters int `json:"maxWaiters,omitempty"` } func (cfg *ConnPoolConfig) MarshalJSON() ([]byte, error) { @@ -477,7 +482,6 @@ func (cfg *ConnPoolConfig) UnmarshalJSON(data []byte) (err error) { IdleTimeout string `json:"idleTimeoutSeconds,omitempty"` MaxLifetime string `json:"maxLifetimeSeconds,omitempty"` PrefillParallelism int `json:"prefillParallelism,omitempty"` - MaxWaiters int `json:"maxWaiters,omitempty"` } if err := json.Unmarshal(data, &tmp); err != nil { @@ -507,7 +511,6 @@ func (cfg *ConnPoolConfig) UnmarshalJSON(data []byte) (err error) { cfg.Size = tmp.Size cfg.PrefillParallelism = tmp.PrefillParallelism - cfg.MaxWaiters = tmp.MaxWaiters return nil } @@ -945,7 +948,6 @@ var defaultConfig = TabletConfig{ OltpReadPool: ConnPoolConfig{ Size: 16, IdleTimeout: 30 * time.Minute, - MaxWaiters: 5000, }, OlapReadPool: ConnPoolConfig{ Size: 200, @@ -955,7 +957,6 @@ var defaultConfig = TabletConfig{ Size: 20, Timeout: time.Second, IdleTimeout: 30 * time.Minute, - MaxWaiters: 5000, }, Olap: OlapConfig{ TxTimeout: 30 * time.Second, diff --git a/go/vt/vttablet/tabletserver/tabletenv/config_test.go b/go/vt/vttablet/tabletserver/tabletenv/config_test.go index c6f65cb94cb..98d4cfceb21 100644 --- a/go/vt/vttablet/tabletserver/tabletenv/config_test.go +++ b/go/vt/vttablet/tabletserver/tabletenv/config_test.go @@ -48,7 +48,6 @@ func TestConfigParse(t *testing.T) { }, OltpReadPool: ConnPoolConfig{ Size: 16, - MaxWaiters: 40, Timeout: 10 * time.Second, IdleTimeout: 20 * time.Second, MaxLifetime: 50 * time.Second, @@ -86,7 +85,6 @@ oltp: {} oltpReadPool: idleTimeoutSeconds: 20s maxLifetimeSeconds: 50s - maxWaiters: 40 size: 16 timeoutSeconds: 10s replicationTracker: {} @@ -109,7 +107,6 @@ txPool: {} oltpReadPool: size: 16 idleTimeoutSeconds: 20s - maxWaiters: 40 maxLifetimeSeconds: 50s `) gotCfg := cfg @@ -148,7 +145,6 @@ oltp: txTimeoutSeconds: 30s oltpReadPool: idleTimeoutSeconds: 30m0s - maxWaiters: 5000 size: 16 queryCacheDoorkeeper: true queryCacheMemory: 33554432 @@ -164,7 +160,6 @@ signalWhenSchemaChange: true streamBufferSize: 32768 txPool: idleTimeoutSeconds: 30m0s - maxWaiters: 5000 size: 20 timeoutSeconds: 1s ` @@ -178,7 +173,6 @@ func TestClone(t *testing.T) { cfg1 := &TabletConfig{ OltpReadPool: ConnPoolConfig{ Size: 16, - MaxWaiters: 40, Timeout: 10 * time.Second, IdleTimeout: 20 * time.Second, MaxLifetime: 50 * time.Second, diff --git a/go/vt/vttablet/tabletserver/tx_pool_test.go b/go/vt/vttablet/tabletserver/tx_pool_test.go index 9edbe5b3592..37500ada79a 100644 --- a/go/vt/vttablet/tabletserver/tx_pool_test.go +++ b/go/vt/vttablet/tabletserver/tx_pool_test.go @@ -305,7 +305,6 @@ func TestTxPoolWaitTimeoutError(t *testing.T) { env := newEnv("TabletServerTest") env.Config().TxPool.Size = 1 - env.Config().TxPool.MaxWaiters = 0 env.Config().TxPool.Timeout = time.Second // given db, txPool, _, closer := setupWithEnv(t, env) @@ -428,7 +427,6 @@ func TestTxTimeoutKillsTransactions(t *testing.T) { env := newEnv("TabletServerTest") env.Config().TxPool.Size = 1 - env.Config().TxPool.MaxWaiters = 0 env.Config().Oltp.TxTimeout = time.Second _, txPool, limiter, closer := setupWithEnv(t, env) defer closer() @@ -477,7 +475,6 @@ func TestTxTimeoutDoesNotKillShortLivedTransactions(t *testing.T) { env := newEnv("TabletServerTest") env.Config().TxPool.Size = 1 - env.Config().TxPool.MaxWaiters = 0 env.Config().Oltp.TxTimeout = time.Second _, txPool, _, closer := setupWithEnv(t, env) defer closer() @@ -510,7 +507,6 @@ func TestTxTimeoutKillsOlapTransactions(t *testing.T) { env := newEnv("TabletServerTest") env.Config().TxPool.Size = 1 - env.Config().TxPool.MaxWaiters = 0 env.Config().Oltp.TxTimeout = time.Second env.Config().Olap.TxTimeout = 2 * time.Second _, txPool, _, closer := setupWithEnv(t, env) @@ -548,7 +544,6 @@ func TestTxTimeoutNotEnforcedForZeroLengthTimeouts(t *testing.T) { env := newEnv("TabletServerTest") env.Config().TxPool.Size = 2 - env.Config().TxPool.MaxWaiters = 0 env.Config().Oltp.TxTimeout = 0 env.Config().Olap.TxTimeout = 0 _, txPool, _, closer := setupWithEnv(t, env) @@ -591,7 +586,6 @@ func TestTxTimeoutReservedConn(t *testing.T) { env := newEnv("TabletServerTest") env.Config().TxPool.Size = 1 - env.Config().TxPool.MaxWaiters = 0 env.Config().Oltp.TxTimeout = time.Second env.Config().Olap.TxTimeout = 2 * time.Second _, txPool, _, closer := setupWithEnv(t, env) @@ -634,7 +628,6 @@ func TestTxTimeoutReusedReservedConn(t *testing.T) { env := newEnv("TabletServerTest") env.Config().TxPool.Size = 1 - env.Config().TxPool.MaxWaiters = 0 env.Config().Oltp.TxTimeout = time.Second env.Config().Olap.TxTimeout = 2 * time.Second _, txPool, _, closer := setupWithEnv(t, env) @@ -820,7 +813,6 @@ func newEnv(exporterName string) tabletenv.Env { cfg.TxPool.Size = 300 cfg.Oltp.TxTimeout = 30 * time.Second cfg.TxPool.Timeout = 40 * time.Second - cfg.TxPool.MaxWaiters = 500000 cfg.OltpReadPool.IdleTimeout = 30 * time.Second cfg.OlapReadPool.IdleTimeout = 30 * time.Second cfg.TxPool.IdleTimeout = 30 * time.Second