Repository navigation
Remove the binary serialization format of settings - #131099
Conversation
After distributed async inserts and the query plan stopped using it, the only user of `SettingsWriteFormat::BINARY` was the native protocol with peers older than revision 54429 (`DBMS_MIN_REVISION_WITH_SETTINGS_SERIALIZED_AS_STRINGS`, 2019). Remove `SettingsWriteFormat` and the format argument of `Settings::write` and `Settings::read`: settings are always written as strings with flags. A peer below revision 54429 can still exchange queries without settings, because an empty list (a single empty name) is the same in both formats. If such a client sends settings, the server throws `NOT_IMPLEMENTED`; the client refuses to send changed settings to such a server. The per-field binary serialization is kept only for the setting types used by `BaseSettings::writeChangedBinary` (object storage settings: numbers, `Bool`, `Seconds`, `String`, enums). It is removed from the other types, including `SettingFieldMap`, the only way from settings into the binary serialization of `Field`. For those types `SettingFieldOps::write_binary`/`read_binary` are null and the accessor throws a `LOGICAL_ERROR`. The native protocol spec is updated accordingly. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Workflow [PR], commit [d9a817c] Summary: ✅
AI ReviewSummaryReviewed #131099 at Final VerdictStatus: ✅ Approve. |
|
Preview deployment for your docs. Learn more about Mintlify Previews.
|
alexey-milovidov
left a comment
There was a problem hiding this comment.
Amazing change! 🚀
`05136_legacy_binary_settings_signed_integer` checked that a setting sent in the binary format by a client below revision 54429 is applied. This format is no longer supported. https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=131099&sha=291cb88d3c46170c41ed8cbfb070e61aaee428e1&name_0=PR&name_1=Fast%20test #131099 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Object file sizes70 object files changed (-54.79 KiB total), 0 added.
711 more object files are built by the master warmup baseline only (it builds every object-file target, a pull request build only Slowest function optimization changes (ThinLTO)Median per-function time ratio to the master baseline:
Compile time of recompiled translation units1231 translation units recompiled, 8687 s compile time in total, 1231 of them have a recent master baseline. |
`DataLakeStorageSettings` include all format settings, so `writeChangedBinary` also serializes `Char`, `UInt64Auto` and `URI` settings (and `Timezone` in the private repository). Restore `writeBinary` and `readBinary` for these types. To catch this at compile time instead of with a `LOGICAL_ERROR` at runtime, every setting in the lists of `DataLakeStorageSettings`, `S3AuthSettings` and `S3RequestSettings` is now checked with `ASSERT_SETTING_SUPPORTS_BINARY_SERIALIZATION`. Add a unit test of the round trip of changed data lake settings of these types and of reading a pinned binary layout. Review: #131099 (comment) Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
🕵 @groeneai, investigate the failure: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=131099&sha=7e6496c276d06182f222890d631c274248763581&name_0=PR&name_1=Stateless%20tests%20%28arm_asan_ubsan%2C%20targeted%29 ( |
|
Acknowledged. The fix is in progress, no PR yet; I'll link it here when it opens. Cause: #118699 replaces the proxy only when nobody else holds it ( |
|
Fixing PR: #131220 . It removes the |
…ngs-serialization
…f `SettingsWriteFormat` The test came from master and still passed `SettingsWriteFormat::STRINGS_WITH_FLAGS` to `Settings::read`, which broke "Clang-tidy (changed files)" in the merge queue: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?REF=gh-readonly-queue/master/pr-131099-048029bd89951fbf901f8f823894aa679789f592&sha=0d2a731ed561adb3293833f26424cdbf511517dd&name_0=MergeQueueCI&name_1=Clang-tidy%20%28changed%20files%29 PR: #131099 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ngs-serialization
…rmat` The merge queue run failed in `Clang-tidy (changed files)`: test `SecondsOnTheWireRejectNegativeAndOverflowingValues` from #131269 passes `SettingsWriteFormat::STRINGS_WITH_FLAGS` to `Settings::read`, which is the only format now. https://github.com/ClickHouse/ClickHouse/actions/runs/43592425942/job/132440172906 Related: #131099 Co-Authored-By: Claude Opus 5.5 <[email protected]>
`StorageSharedMergeTree::setTableStructure` in the private repository applies replicated `ALTER` metadata with `setProperties(..., /*attach = */ true)` and rebuilds `serialization_hints` later in a separate `lockParts` scope, the same window this PR closes for `StorageReplicatedMergeTree`. It hit the `new_hint->structureEquals(*info)` assertion in the stress test of the sync of ClickHouse#131099. To switch it to the new helper it must keep skipping the query-time checks, so the helper takes `attach` like `setProperties` does. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…skip-invalid-values Resolve the conflicts with ClickHouse#131099, which removed `SettingsWriteFormat`: `BaseSettings::read` and `Settings::read` now take only `skip_invalid_values`, and the tolerant parse applies to the single remaining string path. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Conflicts: `src/Client/Connection.cpp`, `src/Core/BaseSettings.h`, `src/Core/Settings.cpp`, `src/Core/Settings.h`. They come from #131099, which removed `SettingsWriteFormat` on master and is not in 26.10. The resolution keeps the `format` argument of `read` and adds `skip_invalid_values` after it, so `Connection::receiveHello` calls `settings.read(*in, SettingsWriteFormat::STRINGS_WITH_FLAGS, true)`. The new `Settings.SkipInvalidValuesKeepsTheDefaultsAndReadsTheRest` test in `gtest_settings.cpp` merged cleanly but is adapted to the same signature. The resulting tree is identical to the resolution proposed in #132962 (comment) (commit `345c09ac114e` of `groeneai/ClickHouse`). Co-Authored-By: Claude Fable 5.2 <[email protected]>
Resolve the conflicts of the cherry-pick of #131636. 26.9 still has `SettingsWriteFormat` (master removed it in #131099), so `read` keeps its `format` argument and takes `skip_invalid_values` after it, as in the first commit of #131636 (669fb8d), which was written against this API. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Resolve the conflicts of the cherry-pick of #131636. 26.8 still has `SettingsWriteFormat` (master removed it in #131099), so `read` keeps its `format` argument and takes `skip_invalid_values` after it, as in the first commit of #131636 (669fb8d), which was written against this API. The new gtest goes right after `SecondsOnTheWireRejectNegativeAndOverflowingValues`. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Remove the binary serialization format of settings (
SettingsWriteFormat::BINARY). Distributed async inserts (#129950) and the query plan (#129973) no longer use it. The only remaining user was the native protocol with peers older than revision 54429 (DBMS_MIN_REVISION_WITH_SETTINGS_SERIALIZED_AS_STRINGS, 2019).SettingsWriteFormatis removed, and so is the format argument ofSettings::writeandSettings::read. Settings are always written as(name, flags, value-as-string).VarUInt 0) is the same in both formats. If such a client sends settings, the server throwsNOT_IMPLEMENTED. The client refuses to send changed settings to such a server.BaseSettings::writeChangedBinary, which serializes object storage settings (S3AuthSettings,S3RequestSettings,DataLakeStorageSettings; the private repository still uses it).DataLakeStorageSettingsinclude all format settings, so these types are numbers,Bool,Seconds,String, enums,Char,UInt64Auto,URIandTimezone. It is removed from the other types:MaxThreads,Map,TriBool,MultiEnum,Custom,ASTFunctionandDataType. This includesSettingFieldMap, the only path from settings into the binary serialization ofField. Every setting in the lists of these three settings classes is checked at compile time withASSERT_SETTING_SUPPORTS_BINARY_SERIALIZATION, so adding a setting of a type without binary serialization there fails the build. For other settings the ops are null, and the accessor throws aLOGICAL_ERRORthat names the setting. A unit test covers the round trip of changed data lake settings of these types and reading a pinned binary layout.writeFieldBinary/readFieldBinarythemselves stay. They are the format of persisted data (statistics, Iceberg data object info, refresh task state) and of the serialized query plan.docs/resources/develop-contribute/native-protocol/protocol.mdx) is updated.Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Clients and servers with native protocol revision older than 54429 (ClickHouse releases from 2019 and older, or third-party drivers that announce such a revision) can no longer pass query settings in the old binary format. Queries without settings still work.
🤖 Generated with Claude Code
Workflow [PR]
Sync PR [sync-upstream/pr/131099]
Version info
26.11.1.2323-master(included in26.11and later)