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

Merged
merged 5 commits into from
Nov 8, 2019

Conversation

tiancaiamao
Copy link
Contributor

@tiancaiamao tiancaiamao commented Nov 5, 2019

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"
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

@mahjonp
Copy link
Contributor

mahjonp commented Nov 5, 2019

/run-check_dev

@codecov
Copy link

codecov bot commented Nov 5, 2019

Codecov Report

Merging #13142 into master will increase coverage by 0.405%.
The diff coverage is n/a.

@@              Coverage Diff               @@
##            master     #13142       +/-   ##
==============================================
+ Coverage   80.346%   80.7511%   +0.405%     
==============================================
  Files          469        468        -1     
  Lines       112283     114417     +2134     
==============================================
+ Hits         90215      92393     +2178     
+ Misses       15135      15134        -1     
+ Partials      6933       6890       -43

@tiancaiamao
Copy link
Contributor Author

/run-all-tests

@tiancaiamao
Copy link
Contributor Author

PTAL @coocood @jackysp

@coocood
Copy link
Member

coocood commented Nov 7, 2019

@tiancaiamao Please update the PR description

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

@tiancaiamao tiancaiamao changed the title tidb-server: relax the config-check tidb-server: handle deprecated configuration item in config-check Nov 7, 2019
@tiancaiamao
Copy link
Contributor Author

@tiancaiamao Please update the PR description

Done @coocood

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

@coocood
Copy link
Member

coocood commented Nov 8, 2019

/merge

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

sre-bot commented Nov 8, 2019

/run-all-tests

@sre-bot
Copy link
Contributor

sre-bot commented Nov 8, 2019

cherry pick to release-3.0 in PR #13272

@sre-bot
Copy link
Contributor

sre-bot commented Nov 8, 2019

cherry pick to release-3.1 in PR #13273

@tiancaiamao tiancaiamao deleted the relex-config-check branch November 8, 2019 03:24
@tiancaiamao
Copy link
Contributor Author

Ref #12594

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.

5 participants