-
Notifications
You must be signed in to change notification settings - Fork 2.3k
yaml: use float64 for durations #6250
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -85,8 +85,8 @@ func init() { | |
| flag.IntVar(¤tConfig.TxPool.PrefillParallelism, "queryserver-config-transaction-prefill-parallelism", defaultConfig.TxPool.PrefillParallelism, "query server transaction prefill parallelism, a non-zero value will prefill the pool using the specified parallism.") | ||
| flag.IntVar(¤tConfig.MessagePostponeParallelism, "queryserver-config-message-postpone-cap", defaultConfig.MessagePostponeParallelism, "query server message postpone cap is the maximum number of messages that can be postponed at any given time. Set this number to substantially lower than transaction cap, so that the transaction pool isn't exhausted by the message subsystem.") | ||
| flag.IntVar(&deprecatedFoundRowsPoolSize, "client-found-rows-pool-size", 0, "DEPRECATED: queryserver-config-transaction-cap will be used instead.") | ||
| flag.IntVar(¤tConfig.Oltp.TxTimeoutSeconds, "queryserver-config-transaction-timeout", defaultConfig.Oltp.TxTimeoutSeconds, "query server transaction timeout (in seconds), a transaction will be killed if it takes longer than this value") | ||
| flag.IntVar(¤tConfig.ShutdownGracePeriodSeconds, "transaction_shutdown_grace_period", defaultConfig.ShutdownGracePeriodSeconds, "how long to wait (in seconds) for transactions to complete during graceful shutdown.") | ||
| flag.Float64Var(¤tConfig.Oltp.TxTimeoutSeconds, "queryserver-config-transaction-timeout", defaultConfig.Oltp.TxTimeoutSeconds, "query server transaction timeout (in seconds), a transaction will be killed if it takes longer than this value") | ||
| flag.Float64Var(¤tConfig.ShutdownGracePeriodSeconds, "transaction_shutdown_grace_period", defaultConfig.ShutdownGracePeriodSeconds, "how long to wait (in seconds) for transactions to complete during graceful shutdown.") | ||
| flag.IntVar(¤tConfig.Oltp.MaxRows, "queryserver-config-max-result-size", defaultConfig.Oltp.MaxRows, "query server max result size, maximum number of rows allowed to return from vttablet for non-streaming queries.") | ||
| flag.IntVar(¤tConfig.Oltp.WarnRows, "queryserver-config-warn-result-size", defaultConfig.Oltp.WarnRows, "query server result size warning threshold, warn if number of rows returned from vttablet for non-streaming queries exceeds this") | ||
| flag.IntVar(&deprecatedMaxDMLRows, "queryserver-config-max-dml-rows", 0, "query server max dml rows per statement, maximum number of rows allowed to return at a time for an update or delete with either 1) an equality where clauses on primary keys, or 2) a subselect statement. For update and delete statements in above two categories, vttablet will split the original query into multiple small queries based on this configuration value. ") | ||
|
|
@@ -95,11 +95,12 @@ func init() { | |
|
|
||
| flag.IntVar(¤tConfig.StreamBufferSize, "queryserver-config-stream-buffer-size", defaultConfig.StreamBufferSize, "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.") | ||
| flag.IntVar(¤tConfig.QueryCacheSize, "queryserver-config-query-cache-size", defaultConfig.QueryCacheSize, "query server query cache size, maximum number of queries to be cached. 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.") | ||
| flag.IntVar(¤tConfig.SchemaReloadIntervalSeconds, "queryserver-config-schema-reload-time", defaultConfig.SchemaReloadIntervalSeconds, "query server schema reload time, how often vttablet reloads schemas from underlying MySQL instance in seconds. vttablet keeps table schemas in its own memory and periodically refreshes it from MySQL. This config controls the reload time.") | ||
| flag.IntVar(¤tConfig.Oltp.QueryTimeoutSeconds, "queryserver-config-query-timeout", defaultConfig.Oltp.QueryTimeoutSeconds, "query server query timeout (in seconds), this is the query timeout in vttablet side. If a query takes more than this timeout, it will be killed.") | ||
| flag.IntVar(¤tConfig.OltpReadPool.TimeoutSeconds, "queryserver-config-query-pool-timeout", defaultConfig.OltpReadPool.TimeoutSeconds, "query server query pool timeout (in seconds), 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.") | ||
| flag.IntVar(¤tConfig.TxPool.TimeoutSeconds, "queryserver-config-txpool-timeout", defaultConfig.TxPool.TimeoutSeconds, "query server transaction pool timeout, it is how long vttablet waits if tx pool is full") | ||
| flag.IntVar(¤tConfig.OltpReadPool.IdleTimeoutSeconds, "queryserver-config-idle-timeout", defaultConfig.OltpReadPool.IdleTimeoutSeconds, "query server idle timeout (in seconds), 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.") | ||
| flag.Float64Var(¤tConfig.SchemaReloadIntervalSeconds, "queryserver-config-schema-reload-time", defaultConfig.SchemaReloadIntervalSeconds, "query server schema reload time, how often vttablet reloads schemas from underlying MySQL instance in seconds. vttablet keeps table schemas in its own memory and periodically refreshes it from MySQL. This config controls the reload time.") | ||
| flag.Float64Var(¤tConfig.Oltp.QueryTimeoutSeconds, "queryserver-config-query-timeout", defaultConfig.Oltp.QueryTimeoutSeconds, "query server query timeout (in seconds), this is the query timeout in vttablet side. If a query takes more than this timeout, it will be killed.") | ||
| flag.Float64Var(¤tConfig.OltpReadPool.TimeoutSeconds, "queryserver-config-query-pool-timeout", defaultConfig.OltpReadPool.TimeoutSeconds, "query server query pool timeout (in seconds), 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.") | ||
| flag.Float64Var(¤tConfig.OlapReadPool.TimeoutSeconds, "queryserver-config-stream-pool-timeout", defaultConfig.OlapReadPool.TimeoutSeconds, "query server stream pool timeout (in seconds), it is how long vttablet waits for a connection from the stream pool. If set to 0 (default) then there is no timeout.") | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like this adds a new command line param to expose an existing yaml config param? |
||
| flag.Float64Var(¤tConfig.TxPool.TimeoutSeconds, "queryserver-config-txpool-timeout", defaultConfig.TxPool.TimeoutSeconds, "query server transaction pool timeout, it is how long vttablet waits if tx pool is full") | ||
| flag.Float64Var(¤tConfig.OltpReadPool.IdleTimeoutSeconds, "queryserver-config-idle-timeout", defaultConfig.OltpReadPool.IdleTimeoutSeconds, "query server idle timeout (in seconds), 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.") | ||
| flag.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") | ||
| flag.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") | ||
| // tableacl related configurations. | ||
|
|
@@ -168,7 +169,7 @@ func Init() { | |
| } | ||
|
|
||
| if enableHeartbeat { | ||
| currentConfig.HeartbeatIntervalMilliseconds = int(heartbeatInterval / time.Millisecond) | ||
| currentConfig.HeartbeatIntervalSeconds = float64(heartbeatInterval) / float64(time.Millisecond) | ||
| } | ||
|
|
||
| switch *streamlog.QueryLogFormat { | ||
|
|
@@ -198,18 +199,18 @@ type TabletConfig struct { | |
| Oltp OltpConfig `json:"oltp,omitempty"` | ||
| HotRowProtection HotRowProtectionConfig `json:"hotRowProtection,omitempty"` | ||
|
|
||
| Consolidator string `json:"consolidator,omitempty"` | ||
| HeartbeatIntervalMilliseconds int `json:"heartbeatIntervalMilliseconds,omitempty"` | ||
| ShutdownGracePeriodSeconds int `json:"shutdownGracePeriodSeconds,omitempty"` | ||
| PassthroughDML bool `json:"passthroughDML,omitempty"` | ||
| StreamBufferSize int `json:"streamBufferSize,omitempty"` | ||
| QueryCacheSize int `json:"queryCacheSize,omitempty"` | ||
| SchemaReloadIntervalSeconds int `json:"schemaReloadIntervalSeconds,omitempty"` | ||
| WatchReplication bool `json:"watchReplication,omitempty"` | ||
| TrackSchemaVersions bool `json:"trackSchemaVersions,omitempty"` | ||
| TerseErrors bool `json:"terseErrors,omitempty"` | ||
| MessagePostponeParallelism int `json:"messagePostponeParallelism,omitempty"` | ||
| CacheResultFields bool `json:"cacheResultFields,omitempty"` | ||
| Consolidator string `json:"consolidator,omitempty"` | ||
| HeartbeatIntervalSeconds float64 `json:"heartbeatIntervalSeconds,omitempty"` | ||
| ShutdownGracePeriodSeconds float64 `json:"shutdownGracePeriodSeconds,omitempty"` | ||
| PassthroughDML bool `json:"passthroughDML,omitempty"` | ||
| StreamBufferSize int `json:"streamBufferSize,omitempty"` | ||
| QueryCacheSize int `json:"queryCacheSize,omitempty"` | ||
| SchemaReloadIntervalSeconds float64 `json:"schemaReloadIntervalSeconds,omitempty"` | ||
| WatchReplication bool `json:"watchReplication,omitempty"` | ||
| TrackSchemaVersions bool `json:"trackSchemaVersions,omitempty"` | ||
| TerseErrors bool `json:"terseErrors,omitempty"` | ||
| MessagePostponeParallelism int `json:"messagePostponeParallelism,omitempty"` | ||
| CacheResultFields bool `json:"cacheResultFields,omitempty"` | ||
|
|
||
| ExternalConnections map[string]*dbconfigs.DBConfigs `json:"externalConnections,omitempty"` | ||
|
|
||
|
|
@@ -231,19 +232,19 @@ type TabletConfig struct { | |
|
|
||
| // ConnPoolConfig contains the config for a conn pool. | ||
| type ConnPoolConfig struct { | ||
| Size int `json:"size,omitempty"` | ||
| TimeoutSeconds int `json:"timeoutSeconds,omitempty"` | ||
| IdleTimeoutSeconds int `json:"idleTimeoutSeconds,omitempty"` | ||
| PrefillParallelism int `json:"prefillParallelism,omitempty"` | ||
| MaxWaiters int `json:"maxWaiters,omitempty"` | ||
| Size int `json:"size,omitempty"` | ||
| TimeoutSeconds float64 `json:"timeoutSeconds,omitempty"` | ||
| IdleTimeoutSeconds float64 `json:"idleTimeoutSeconds,omitempty"` | ||
| PrefillParallelism int `json:"prefillParallelism,omitempty"` | ||
| MaxWaiters int `json:"maxWaiters,omitempty"` | ||
| } | ||
|
|
||
| // OltpConfig contains the config for oltp settings. | ||
| type OltpConfig struct { | ||
| QueryTimeoutSeconds int `json:"queryTimeoutSeconds,omitempty"` | ||
| TxTimeoutSeconds int `json:"txTimeoutSeconds,omitempty"` | ||
| MaxRows int `json:"maxRpws,omitempty"` | ||
| WarnRows int `json:"warnRows,omitempty"` | ||
| QueryTimeoutSeconds float64 `json:"queryTimeoutSeconds,omitempty"` | ||
| TxTimeoutSeconds float64 `json:"txTimeoutSeconds,omitempty"` | ||
| MaxRows int `json:"maxRpws,omitempty"` | ||
| WarnRows int `json:"warnRows,omitempty"` | ||
| } | ||
|
|
||
| // HotRowProtectionConfig contains the config for hot row protection. | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How are the params grouped? I would have expected a grouping either by type (BoolVar/IntVar/Float64Var) or by "config group" (Oltp/OltpReadPool) etc..