Repository navigation
Stricter tryParse - #52503
Stricter tryParse#52503
tryParse#52503Conversation
|
This is an automated comment for commit 65cbe94 with description of existing statuses. It's updated for the latest CI running ✅ Click here to open a full report in a separate page Successful checks
|
antaljanosbenjamin
left a comment
There was a problem hiding this comment.
I like the changes as more strict rules are usually better, but based on the tests it might be tricky to introduce this functionality as it adds an extra requirement to the buffer.
I think it is reasonable to try to track down the usage of these functions and make sure we don't build on an assumption that is not true everywhere.
…se into more-strict-tryparse
|
Dear @antaljanosbenjamin, this PR hasn't been updated for a while. You will be unassigned. Will you continue working on it? If so, please feel free to reassign yourself. |
|
This change makes sense, only need to fix a few parts around backups. |
|
This change is too large to backport (it can break something else), but we can extract the fix related to DeltaLake and backport separately. |
The automatic value of settings like `max_threads` shows up in `system.settings` as `'auto(64)'` - with literal single quotes baked right into the string value. They are pure garbage and have annoyed me for years. Back in 2023 I removed them in a commit titled, with great restraint, "Fix strange trash". Konstantin promptly put the trash back in ClickHouse#68979 (branch `put-strange-trash-back`, commit "Revert \"Fix strange trash\""). And, in fairness, he was right at the time: the parser only understood the quoted form, so a new un-quoted server could not parse the `'auto(N)'` that older replicas send over the wire as a setting string, which broke mixed-version clusters (ClickHouse#68748). That obstacle is now gone. `stringToMaxThreads` accepts both `auto(N)` and the legacy `'auto(N)'`, so emitting the clean form is safe in both directions: an old replica's quoted value is still parsed by us, and every released version can already parse the un-quoted value we now send. So the strange trash goes back out - and this time the tolerant parser stays, so it stays out for good. Changes: - `SettingFieldMaxThreads::toString` now returns `auto(N)` without quotes. - Documented why `stringToMaxThreads` must keep accepting the legacy quoted form (it is the mixed-version-cluster compatibility guarantee). - Updated test `04202_set_default_preserves_max_threads_auto` and the `test_cgroup_limit` integration test to match the clean form. - The upgrade check (`upgrade_runner.sh`) now ignores `auto(...)` values when diffing settings against the previous release, so the quoted-vs-unquoted rendering is not reported as a setting change. - Updated the `system.settings` example in the docs. Related: ClickHouse#68748 Related: ClickHouse#68979 Related: ClickHouse#52503 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
The automatic value of settings like `max_threads` shows up in `system.settings` as `'auto(64)'` - with literal single quotes baked right into the string value. They are pure garbage and have annoyed me for years. Back in 2023 I removed them in a commit titled, with great restraint, "Fix strange trash". Konstantin promptly put the trash back in ClickHouse#68979 (branch `put-strange-trash-back`, commit "Revert \"Fix strange trash\""). And, in fairness, he was right at the time: the parser only understood the quoted form, so a new un-quoted server could not parse the `'auto(N)'` that older replicas send over the wire as a setting string, which broke mixed-version clusters (ClickHouse#68748). That obstacle is now gone. `stringToMaxThreads` accepts both `auto(N)` and the legacy `'auto(N)'`, so emitting the clean form is safe in both directions: an old replica's quoted value is still parsed by us, and every released version can already parse the un-quoted value we now send. So the strange trash goes back out - and this time the tolerant parser stays, so it stays out for good. Changes: - `SettingFieldMaxThreads::toString` now returns `auto(N)` without quotes. - Documented why `stringToMaxThreads` must keep accepting the legacy quoted form (it is the mixed-version-cluster compatibility guarantee). - Updated test `04202_set_default_preserves_max_threads_auto` and the `test_cgroup_limit` integration test to match the clean form. - The upgrade check (`upgrade_runner.sh`) now ignores `auto(...)` values when diffing settings against the previous release, so the quoted-vs-unquoted rendering is not reported as a setting change. - Updated the `system.settings` example in the docs. Related: ClickHouse#68748 Related: ClickHouse#68979 Related: ClickHouse#52503 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Hardened parts of the codebase related to parsing of small entities. The following (minor) bugs were found and fixed: - if a
DeltaLaketable is partitioned by Bool, the partition value is always interpreted as false; -ExternalDistributedtable was using only a single shard in the provided addresses; the value ofmax_threadssetting and similar were printed as'auto(N)'instead ofauto(N).CI Settings (Only check the boxes if you know what you are doing):