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

Allow all possible experimental indexes on restore #245

Conversation

dmitry-potepalov
Copy link
Contributor

Presently we don't know which experimental features/indexes were enabled during table creation, because those could have been enabled on a per-session/per-query basis and not captured in the create_table_query. To avoid failures on restore, just enable all experimental features when creating the tables. Should be relatively harmless, since it affects only the restoration session; also most of those flags do not affect tables that don't have experimental indexes.

Presently we don't know which experimental features/indexes were enabled
during table creation, because those could have been enabled on a
per-session/per-query basis and not captured in the create_table_query.
To avoid failures on restore, just enable all experimental features
when creating the tables. Should be relatively harmless, since it
affects only the restoration session; also most of those flags do not
affect tables that don't have experimental indexes.
@dmitry-potepalov dmitry-potepalov marked this pull request as ready for review October 9, 2024 09:14
@dmitry-potepalov dmitry-potepalov requested a review from a team October 9, 2024 09:21
b"SET allow_suspicious_codecs=true",
b"SET allow_hyperscan=true",
b"SET allow_simdjson=true",
b"SET allow_deprecated_syntax_for_merge_tree=true",
Copy link
Contributor

Choose a reason for hiding this comment

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

Good work. The only thing I am concerned about is compatibility.
Previously the list was conservative and now it is quite wide.
It is possible that some very new option is not available on a running clickhouse, and will cause error like this

clickhouse01 :) set test=1

Received exception from server (version 24.8.4):
Code: 115. DB::Exception: Received from localhost:9000. DB::Exception: Unknown setting 'test'. (UNKNOWN_SETTING)

Which is extremely unpleasant during restoration.
I think it makes sense to just ignore those errors or check if the setting is available using system.settings table.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is possible that some very new option is not available on a running clickhouse

I've taken the list from the major we're running presently

dmitry.potepalov@dpotepalov-test:~/ClickHouse$ git describe
v23.8.8.20-lts

unless we manually call /restore on a running node, the node performing the restore should run CH no older than this LTS -> all the setting should be there. To me manually doing /restore looks like a rather obscure edge case, I'd keep the list synced with the LTS we want the new nodes to run

Copy link
Contributor Author

Choose a reason for hiding this comment

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

unless we manually call /restore on a running node

and that's actually also an edge case for a future update of that list, since the old nodes don't have the extended list and the new nodes already have 23.8 LTS

Copy link
Contributor

Choose a reason for hiding this comment

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

You are right, but I think it is easier to just add the safety guard and forget about possible problems:

  1. may be someone is using this open source project)
  2. it is actually better to add all the settings from the latest clickhouse, rather then currently used lts
  3. situation may change in the future it is better to just be prepared
    I really do not see a reason to not protect this place.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

dynamic check against available settings is IMHO overkill, I've added a handler for the UNKNOWN_SETTING error, there's indeed some value in that.

Just in case we're running against an older CH version, ignore an
experimental setting we cannot enable.
@Khatskevich Khatskevich merged commit a6ab248 into main Oct 9, 2024
2 checks passed
@Khatskevich Khatskevich deleted the dmitry-potepalov/clickhouse/allow-experimental-indexes-on-restore branch October 9, 2024 12:32
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.

2 participants