mirror of
https://github.com/hanzoai/datastore.git
synced 2026-09-26 13:55:07 +00:00
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 #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 (#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: https://github.com/ClickHouse/ClickHouse/issues/68748 Related: https://github.com/ClickHouse/ClickHouse/pull/68979 Related: https://github.com/ClickHouse/ClickHouse/pull/52503 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>