Skip to content

Commit

Permalink
vttablet: rename grace period to ShutdownSeconds
Browse files Browse the repository at this point in the history
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
  • Loading branch information
sougou committed Nov 10, 2020
1 parent 21591f9 commit c7004d2
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions config/tablet/default.yaml
Expand Up @@ -84,8 +84,8 @@ healthcheck:
unhealthyThresholdSeconds: 7200 # unhealthy_threshold

gracePeriods:
transactionShutdownSeconds: 0 # transaction_shutdown_grace_period
transitionSeconds: 0 # serving_state_grace_period
shutdownSeconds: 0 # shutdown_grace_period
transitionSeconds: 0 # serving_state_grace_period

replicationTracker:
mode: disable # enable_replication_reporter
Expand Down
7 changes: 4 additions & 3 deletions go/vt/vttablet/tabletserver/tabletenv/config.go
Expand Up @@ -93,7 +93,8 @@ func init() {
flag.IntVar(&currentConfig.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.")
SecondsVar(&currentConfig.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")
SecondsVar(&currentConfig.GracePeriods.TransactionShutdownSeconds, "transaction_shutdown_grace_period", defaultConfig.GracePeriods.TransactionShutdownSeconds, "how long to wait (in seconds) for transactions to complete during graceful shutdown.")
SecondsVar(&currentConfig.GracePeriods.ShutdownSeconds, "shutdown_grace_period", defaultConfig.GracePeriods.ShutdownSeconds, "how long to wait (in seconds) for queries and transactions to complete during graceful shutdown.")
SecondsVar(&currentConfig.GracePeriods.ShutdownSeconds, "transaction_shutdown_grace_period", defaultConfig.GracePeriods.ShutdownSeconds, "DEPRECATED: use shutdown_grace_period instead.")
flag.IntVar(&currentConfig.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(&currentConfig.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. ")
Expand Down Expand Up @@ -305,8 +306,8 @@ type HealthcheckConfig struct {
// GracePeriodsConfig contains various grace periods.
// TODO(sougou): move lameduck here?
type GracePeriodsConfig struct {
TransactionShutdownSeconds Seconds `json:"transactionShutdownSeconds,omitempty"`
TransitionSeconds Seconds `json:"transitionSeconds,omitempty"`
ShutdownSeconds Seconds `json:"shutdownSeconds,omitempty"`
TransitionSeconds Seconds `json:"transitionSeconds,omitempty"`
}

// ReplicationTrackerConfig contains the config for the replication tracker.
Expand Down
2 changes: 1 addition & 1 deletion go/vt/vttablet/tabletserver/tx_engine.go
Expand Up @@ -107,7 +107,7 @@ func NewTxEngine(env tabletenv.Env) *TxEngine {
config := env.Config()
te := &TxEngine{
env: env,
shutdownGracePeriod: config.GracePeriods.TransactionShutdownSeconds.Get(),
shutdownGracePeriod: config.GracePeriods.ShutdownSeconds.Get(),
reservedConnStats: env.Exporter().NewTimings("ReservedConnections", "Reserved connections stats", "operation"),
}
limiter := txlimiter.New(env)
Expand Down
4 changes: 2 additions & 2 deletions go/vt/vttablet/tabletserver/tx_engine_test.go
Expand Up @@ -47,7 +47,7 @@ func TestTxEngineClose(t *testing.T) {
config.DB = newDBConfigs(db)
config.TxPool.Size = 10
config.Oltp.TxTimeoutSeconds = 0.1
config.GracePeriods.TransactionShutdownSeconds = 0
config.GracePeriods.ShutdownSeconds = 0
te := NewTxEngine(tabletenv.NewEnv(config, "TabletServerTest"))

// Normal close.
Expand Down Expand Up @@ -515,7 +515,7 @@ func setupTxEngine(db *fakesqldb.DB) *TxEngine {
config.DB = newDBConfigs(db)
config.TxPool.Size = 10
config.Oltp.TxTimeoutSeconds = 0.1
config.GracePeriods.TransactionShutdownSeconds = 0
config.GracePeriods.ShutdownSeconds = 0
te := NewTxEngine(tabletenv.NewEnv(config, "TabletServerTest"))
return te
}
Expand Down

0 comments on commit c7004d2

Please sign in to comment.