databend icon indicating copy to clipboard operation
databend copied to clipboard

Feature: Allow Unsupported Configurations to Output Warning Instead of Error

Open everpcpc opened this issue 10 months ago • 6 comments

Currently, when encountering unsupported configurations in the configuration file, the program exits with an error. This behavior causes compatibility issues between new configurations and older binaries. It would be beneficial to allow unsupported configurations to only output a warning instead of causing the program to exit. This change would improve compatibility and provide a smoother user experience.

everpcpc avatar Feb 17 '25 02:02 everpcpc

We currently do not allow breaking changes to configs. All deprecated configurations should be retained as they are and should display a warning, similar to the example below:

https://github.com/databendlabs/databend/blob/d41e0521aa9c78a6a8bdedb847fbc6cbb12cdb01/src/query/config/src/config.rs#L502-L516

We can convert them into warnings instead.

Xuanwo avatar Feb 17 '25 08:02 Xuanwo

We currently do not allow breaking changes to configs. All deprecated configurations should be retained as they are and should display a warning, similar to the example below:

Yes, that's using new binary with old configs. But we are having issues in the opposite way.

everpcpc avatar Feb 17 '25 08:02 everpcpc

Would you like to share an error in such cases? We didn't set deny_unknown_fields for serde, this case should just be ignored.

Xuanwo avatar Feb 17 '25 08:02 Xuanwo

Databend Query start failure, cause: anyhow. Code: 11002, Text = TOML parse error at line 50, column 3
50
jwks_refresh_interval = 30
^^^^^^^^^^^^^^^^^^^^^
unknown field `jwks_refresh_interval`, expected one of `teenant_id`, `cluster_id`, `num_cpus`, `mysql_handler_host`,`mysql_handler_port', `mysql_handl
source: None

everpcpc avatar Feb 17 '25 09:02 everpcpc

Would you like to share an error in such cases? We didn't set deny_unknown_fields for serde, this case should just be ignored.

i think we've set deny_unknown_fields for these options 👀

$ git grep 'deny_unknown_fields'
src/query/config/src/config.rs:#[serde(default, deny_unknown_fields)]
src/query/config/src/config.rs:/// deny_unknown_fields to check unknown field, like the deprecated `address`.
src/query/config/src/config.rs:#[serde(default, deny_unknown_fields)]
src/query/config/src/config.rs:#[serde(default, deny_unknown_fields)]
src/query/config/src/config.rs:#[serde(default, deny_unknown_fields)]
src/query/config/src/config.rs:#[serde(default, deny_unknown_fields)]
src/query/config/src/config.rs:#[serde(default, deny_unknown_fields)]

flaneur2020 avatar Feb 17 '25 09:02 flaneur2020

i think we've set deny_unknown_fields for these options 👀

It does not work.

sundy-li avatar Mar 13 '25 03:03 sundy-li