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
Merged

config: check undefined config item #1362

merged 7 commits into from
Dec 10, 2018

Conversation

Connor1996
Copy link
Member

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,

@nolouch
Copy link
Contributor

nolouch commented Dec 7, 2018

/run-unit-test

server/config_test.go Outdated Show resolved Hide resolved
@Connor1996
Copy link
Member Author

PTAL @nolouch @disksing

@rleungx
Copy link
Member

rleungx commented Dec 10, 2018

CI failed.

@Connor1996
Copy link
Member Author

/run-unit-test

@nolouch nolouch merged commit ceb8cec into tikv:master Dec 10, 2018
Connor1996 added a commit to Connor1996/pd that referenced this pull request Dec 12, 2018
nolouch pushed 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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants