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

Check configuration #7103

Closed
breezewish opened this issue Jul 19, 2018 · 10 comments
Closed

Check configuration #7103

breezewish opened this issue Jul 19, 2018 · 10 comments
Assignees
Labels
type/question The issue belongs to a question.

Comments

@breezewish
Copy link
Member

Currently TiDB does not check most of the configuration. It would be nice to check and warn users when something is not configured correctly / valid.

@jackysp jackysp added the type/question The issue belongs to a question. label Jul 19, 2018
@jackysp
Copy link
Member

jackysp commented Jul 19, 2018

@breeswish , can you list the configuration items that need to be checked?

@breezewish
Copy link
Member Author

@jackysp I'm not an expert on this and I'm afraid I can't list them without left. I know at least for tikv-client, the newly introduced grpc time and timeout should be checked, i.e. must not be 0. Also, for existing configurations, the grpc connection count should be definitely > 0 as well.

@jackysp
Copy link
Member

jackysp commented Jul 19, 2018

The existing grpc connection count was checked at

if cfg.TiKVClient.GrpcConnectionCount > 0 {

I think we only need to do the same thing in the new pr.

@breezewish
Copy link
Member Author

breezewish commented Jul 19, 2018

I think it's not right to silently ignore the wrong configuration and use default values, which hides the error and make it undetectable.

@breezewish
Copy link
Member Author

Also there is a lot of other kind of "durations" in the rest of the config, which is not checked.

@jackysp
Copy link
Member

jackysp commented Jul 19, 2018

The configuration check has been done once. The principle at the time was to leave as much room as possible for each configuration. If you want to limit more configurations, I think somebody will disagree with you, except me. :)
So I think if you want to check the configurations you added, just do it.

@shenli
Copy link
Member

shenli commented Jul 20, 2018

@breeswish We already have validation for the configuration. If 0 is an invalid value for grpc-timeout, I think it is OK to check it.

@kolbe
Copy link
Contributor

kolbe commented Mar 20, 2019

Maybe this is not the place to discuss this, but I'm a little concerned about the behavior in TiDB to silently ignore invalid configuration options. For example, I put "status-port" outside of the [status] section of config.toml and was tearing my hair out wondering why it wasn't working before I figured out what I was doing. IMO, tidb-server should simply refuse to start if someone uses a configuration option that doesn't exist. This helps users avoid wasting time (and maybe endangering their data or production environment!) doing something silly like I did, or mis-spelling an option, etc.

@kolbe
Copy link
Contributor

kolbe commented Mar 21, 2019

@GregoryIan Morgan suggested I ping you regarding my suggestion that tidb-server (and other components of TiDB Platform) should refuse to start if there are any unrecognized items in the configuration file(s).

@kolbe
Copy link
Contributor

kolbe commented May 15, 2019

@breeswish we now have support in tidb-server for --config-check and --config-strict:

  -config-check
        check config file validity and exit (default false)
  -config-strict
        enforce config file validity (default false)

I would like to see --config-strict be the default behavior; maybe we can get there in a future release.

I think these items address your original concern, so I'm going to close this issue now, but please re-open it if you have additional questions or ongoing concerns about this topic. I agree it's very important.

@kolbe kolbe closed this as completed May 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/question The issue belongs to a question.
Projects
None yet
Development

No branches or pull requests

4 participants