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

config: check undefined config item #1362

Merged
merged 7 commits into from Dec 10, 2018

Conversation

Projects
None yet
5 participants
@Connor1996
Copy link
Member

Connor1996 commented Dec 6, 2018

What problem does this PR solve?

We may miswrite the config name, and it is hard to find unless we check the config log carefully.

What is changed and how it works?

When PD restart, check the config undecoded field to find whether there is any undefined config.

Check List

  • Unit test
  • Manual test (add detailed scripts or steps below)

Test steps

  • start PD with the default config file
>> ./bin/pd-server -config conf/config.toml
......
2018/12/06 21:38:16.482 leader.go:264: [info] PD cluster leader pd is ready to serve
  • start PD with config file having undefined config
>> cat config1.toml
type = "pd"
>> ./bin/pd-server -config config1.toml
FATA[0000] parse cmd flags error: Config contains undefined item: type,
  • start PD with config file having a wrong scheduler name
>> cat config2.toml
[[schedule.schedulers]]
type = "random-merge-schedulers"
args = [""]
>> ./bin/pd-server -config config2.toml
2018/12/06 21:50:04.637 log.go:274: [fatal] panic: can not create scheduler random-merge-schedulers: create func of random-merge-schedulers is not registered,

Connor1996 added some commits Dec 6, 2018

@nolouch

This comment has been minimized.

Copy link
Member

nolouch commented Dec 7, 2018

/run-unit-test

Show resolved Hide resolved server/config_test.go Outdated
@Connor1996

This comment has been minimized.

Copy link
Member Author

Connor1996 commented Dec 10, 2018

@rleungx

This comment has been minimized.

Copy link
Member

rleungx commented Dec 10, 2018

CI failed.

fix
@Connor1996

This comment has been minimized.

Copy link
Member Author

Connor1996 commented Dec 10, 2018

/run-unit-test

Connor1996 and others added some commits Dec 10, 2018

@nolouch nolouch merged commit ceb8cec into pingcap:master Dec 10, 2018

5 checks passed

ci/circleci Your tests passed on CircleCI!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
jenkins-ci-pd/build Jenkins job succeeded.
Details
jenkins-ci-pd/unit-test Jenkins job succeeded.
Details
license/cla Contributor License Agreement is signed.
Details

Connor1996 added a commit to Connor1996/pd that referenced this pull request Dec 12, 2018

nolouch added a commit that referenced this pull request Dec 12, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.