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

Skip unknown settings with warnings. #7653

Merged

Conversation

vitlibar
Copy link
Member

@vitlibar vitlibar commented Nov 6, 2019

I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en

Changelog category:

  • New feature

Changelog entry:
Allow skipping unknown settings with warnings instead of throwing exceptions.

@alexey-milovidov
Copy link
Member

I prefer to simply pass all settings as strings in new format. This will make code easier.

@vitlibar vitlibar force-pushed the skip-unknown-settings-with-warnings branch 3 times, most recently from 5dd4fca to c4b49e6 Compare November 6, 2019 17:47
@vitlibar
Copy link
Member Author

vitlibar commented Nov 6, 2019

I prefer to simply pass all settings as strings in new format. This will make code easier.

Done.

@vitlibar vitlibar force-pushed the skip-unknown-settings-with-warnings branch 2 times, most recently from fdd9d59 to 428f93e Compare November 8, 2019 01:26
Copy link
Contributor

@nvartolomei nvartolomei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Current behaviour caused us many headaches, but in my opinion this approach is far from ideal. I don't think the server should be the one deciding on silently (from client's perspective) ignore settings.

This might seem like a personal preference, but I'll try and prove my point by going through some examples for which this approach might be fatal.

totals_mode
distributed_product_mode
join_use_nulls
extremes
Suppose these (or similar settings which change query behaviour/result) are introduced in a new version which is not yet fully deployed on a cluster. A user might use them and get wrong results without realising it (in theory we can forbid adding new setting that changes query behaviour and instead add them at query syntax level).

Also, this PR doesn't seem complete: it should probably allow to ignore unknown settings values as well.

A better solution in my opinion would be for the server to expose list of supported settings (optionally, supported values), and let the client decide whether or not these settings are enough to execute the query.

@filimonov
Copy link
Contributor

filimonov commented Nov 8, 2019

I think that changing way of serialization and have a possibility to ignore unknown settings is good .

At the same time the decision "to ignore / not ignore" particular (or all) settings should be controlled by user IMO (from both ends - client or server).

So client can send smth like 'ignore_unknown_settings=0' (by default), can be set to 1 during rolling updates in cluster, or even "ignore_unknown_settings=totals_mode,distributed_product_mode" (will be ignored only is server does not support them).

Or server admin can decide that he doesn't care if newer clients send something like 'mimic_old_version_behavior=true'.

@vitlibar
Copy link
Member Author

vitlibar commented Nov 8, 2019

A better solution in my opinion would be for the server to expose list of supported settings (optionally, supported values), and let the client decide whether or not these settings are enough to execute the query.

I'll try to implement a slightly different solution. The client will send can_ignore flag with every sent value and this flag will be calculated based on the setting and its value. If the server doesn't know this setting it will use this flag to decide what to do.

So client can send smth like 'ignore_unknown_settings=0' (by default), can be set to 1 during updates in cluster, or even "ignore_unknown_settings=totals_mode,distributed_product_mode" (will be ignored only is server does not support them).

It seems the client will be able to calculate that can_ignore flag without extra settings.

@filimonov
Copy link
Contributor

It seems the client will be able to calculate that can_ignore flag without extra settings.

Does it mean that the decision allowing / forbidding ignorance will be hardcoded?
What if i prefer not to ignore that?

@vitlibar vitlibar force-pushed the skip-unknown-settings-with-warnings branch from 98a3a80 to e40c140 Compare November 17, 2019 00:57
@vitlibar vitlibar merged commit 681f03c into ClickHouse:master Nov 18, 2019
@vitlibar
Copy link
Member Author

It seems the client will be able to calculate that can_ignore flag without extra settings.

Does it mean that the decision allowing / forbidding ignorance will be hardcoded?
What if i prefer not to ignore that?

The names and meanings of the settings are hardcoded, so it seems the ignorance flag should be hardcoded too. The developers of new settings will decide whether they can be ignored or not.

@vitlibar vitlibar deleted the skip-unknown-settings-with-warnings branch November 18, 2019 11:00
@tavplubix tavplubix added the pr-bugfix Pull request with bugfix, not backported by default label Nov 18, 2019
tavplubix pushed a commit that referenced this pull request Nov 19, 2019
…nings

Skip unknown settings with warnings.
@vitlibar vitlibar added pr-feature Pull request with new product feature and removed pr-bugfix Pull request with bugfix, not backported by default v19.17 labels Nov 20, 2019
tavplubix added a commit that referenced this pull request Nov 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-feature Pull request with new product feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants