Skip to content
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

tidb-server: handle deprecated configuration item in config-check (#13142) #13272

Merged
merged 3 commits into from
Nov 8, 2019

Conversation

sre-bot
Copy link
Contributor

@sre-bot sre-bot commented Nov 8, 2019

cherry-pick #13142 to release-3.0


What problem does this PR solve?

Make using tidb-ansible to rolling update TiDB smooth.

Providing that there is a "pessimistic.ttl = 40s" in the config file, before this PR:

➜  tidb git:(master) ✗ ./bin/tidb-server -config ./config/config.toml.example -config-check 
FATA[0000] config file ./config/config.toml.example contained unknown configuration options: pessimistic-txn.ttl

After this PR:

➜  tidb git:(relex-config-check) ✗ ./bin/tidb-server -config ./config/config.toml.example -config-check 
config check successful

➜  tidb git:(relex-config-check) ✗ ./bin/tidb-server -config ./config/config.toml.example -config-strict
[2019/11/07 21:34:48.432 +08:00] [WARN] [main.go:170] ["config file ./config/config.toml.example contained unknown configuration options: pessimistic-txn.ttl"]
[2019/11/07 21:34:48.432 +08:00] [INFO] [printer.go:40] ["Welcome to TiDB."] ["Release Version"=v4.0.0-alpha-730-g64ab90bda] ["Git Commit Hash"=64ab90bda3c88d25df30dbcbeca0c4d82dd86253] ["Git Branch"=relex-config-check] ["UTC Build Time"="2019-11-07 01:33:48"] [GoVersion="go version go1.13.1 linux/amd64"] ["Race Enabled"=false] ["Check Table Before Drop"=false] ["TiKV Min Version"=v3.0.0-60965b006877ca7234adaced7890d7b029ed1306]
[2019/11/07 21:34:48.433 +08:00] [INFO] [printer.go:53] ["loaded config"] [config="{\"host\":\"0.0.0.0\",\"advertise-address\":\"\",\"port\":4000,\"cors\":\"\",\"store\":\"mocktikv\",\"path\":\"/tmp/tidb\",\"socket\":\"\",\"lease\":\"45s\",\"run-ddl\":true,\"split-table\":true,\"token-limit\":1000,\"oom-use-tmp-storage\":true,\"oom-action\":\"log\",\"mem-quota-query\":34359738368,\"enable-streaming\":false,\"txn-local-latches\":{\"enabled\":false,\"capacity\":2048000},\"lower-case-table-names\":2,\"log\":{\"level\":\"info\",\"format\":\"text\",\"disable-timestamp\":null,\"enable-timestamp\":null,\"disable-error-stack\":null,\"enable-error-stack\":null,\"file\":{\"filename\":\"\",\"max-size\":300,\"max-days\":0,\"max-backups\":0},\"slow-query-file\":\"tidb-slow.log\",\"slow-threshold\":300,\"expensive-threshold\":10000,\"query-log-max-len\":4096,\"record-plan-in-slow-log\":1},\"security\":{\"skip-grant-table\":false,\"ssl-ca\":\"\",\"ssl-cert\":\"\",\"ssl-key\":\"\",\"cluster-ssl-ca\":\"\",\"cluster-ssl-cert\":\"\",\"cluster-ssl-key\":\"\"},\"status\":{\"status-host\":\"0.0.0.0\",\"metrics-addr\":\"\",\"status-port\":10080,\"metrics-interval\":15,\"report-status\":true,\"record-db-qps\":false},\"performance\":{\"max-procs\":0,\"max-memory\":0,\"stats-lease\":\"3s\",\"stmt-count-limit\":5000,\"feedback-probability\":0.05,\"query-feedback-limit\":1024,\"pseudo-estimate-ratio\":0.8,\"force-priority\":\"NO_PRIORITY\",\"bind-info-lease\":\"3s\",\"txn-total-size-limit\":104857600,\"tcp-keep-alive\":true,\"cross-join\":true,\"run-auto-analyze\":true},\"prepared-plan-cache\":{\"enabled\":false,\"capacity\":100,\"memory-guard-ratio\":0.1},\"opentracing\":{\"enable\":false,\"rpc-metrics\":false,\"sampler\":{\"type\":\"const\",\"param\":1,\"sampling-server-url\":\"\",\"max-operations\":0,\"sampling-refresh-interval\":0},\"reporter\":{\"queue-size\":0,\"buffer-flush-interval\":0,\"log-spans\":false,\"local-agent-host-port\":\"\"}},\"proxy-protocol\":{\"networks\":\"\",\"header-timeout\":5},\"tikv-client\":{\"grpc-connection-count\":4,\"grpc-keepalive-time\":10,\"grpc-keepalive-timeout\":3,\"commit-timeout\":\"41s\",\"max-batch-size\":128,\"overload-threshold\":200,\"max-batch-wait-time\":0,\"batch-wait-size\":8,\"enable-arrow\":true,\"region-cache-ttl\":600},\"binlog\":{\"enable\":false,\"ignore-error\":false,\"write-timeout\":\"15s\",\"binlog-socket\":\"\",\"strategy\":\"range\"},\"compatible-kill-query\":false,\"plugin\":{\"dir\":\"\",\"load\":\"\"},\"pessimistic-txn\":{\"enable\":true,\"max-retry-count\":256},\"check-mb4-value-in-utf8\":true,\"treat-old-version-utf8-as-utf8mb4\":true,\"enable-table-lock\":false,\"delay-clean-table-lock\":0,\"split-region-max-num\":1000,\"stmt-summary\":{\"max-stmt-count\":100,\"max-sql-length\":4096}}"]

What is changed and how it works?

Maintain a deprecated configure item list, if the unknown configure option belongs to the list,
return a warning instead of panic.

Check List

Tests

  • Manual test (add detailed scripts or steps below)

Side effects

  • Breaking backward compatibility

Related changes

  • Need to cherry-pick to the release branch

config-check means "check config and exit"
config-strict means "enforce config file validity"
@sre-bot
Copy link
Contributor Author

sre-bot commented Nov 8, 2019

/run-all-tests

Copy link
Member

@coocood coocood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@jackysp jackysp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jackysp jackysp added the status/can-merge Indicates a PR has been approved by a committer. label Nov 8, 2019
@sre-bot
Copy link
Contributor Author

sre-bot commented Nov 8, 2019

/run-all-tests

@sre-bot sre-bot merged commit e7e6c4e into pingcap:release-3.0 Nov 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/server status/can-merge Indicates a PR has been approved by a committer.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants