Repository navigation
Mark the ZXC codec as experimental - #111007
Conversation
The `ZXC` codec was added in #110620 but, unlike the other recently added codecs (`ALP`, `SZ3`), it was not placed in the experimental category. Mark it experimental so that using it requires `SET allow_experimental_codecs = 1`, matching the convention for new codecs that are not yet meant for production. - `CompressionCodecZXC::isExperimental` now returns `true`, so the codec is rejected with `BAD_ARGUMENTS` unless `allow_experimental_codecs` is enabled, and `system.compression_codecs` reports it as experimental. - Test `04545_zxc_codec` enables the setting and adds a negative case that the codec is rejected without it. - Documentation gets an experimental badge and note. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
Preview deployment for your docs. Learn more about Mintlify Previews.
|
|
Workflow [PR], commit [4ec42a3] Summary: ✅
AI ReviewSummaryThis PR marks Final Verdict
|
…t spec for experimental ZXC Marking `ZXC` experimental flips its `system.codecs` row from `is_experimental = 0` to `1` (via `CompressionCodecFactory::fillCodecDescriptions` reading `isExperimental` directly), so update the checked-in reference in `01222_system_codecs.reference`. Also add the `allow_experimental_codecs` gate note for `0x9f` (`ZXC`) to the Native format specification `NativeFormat.md`, consistent with `SZ3` and `Quantized`. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…MergeTree settings The settings `marks_compression_codec`, `primary_key_compression_codec` and `default_compression_codec` were validated with plain `CompressionCodecFactory::get`, which never checks `isExperimental`, so `CREATE TABLE ... SETTINGS default_compression_codec = 'ZXC'` (and the corresponding `ALTER TABLE ... MODIFY SETTING`) accepted an experimental codec with `allow_experimental_codecs = 0`. Add `CompressionCodecFactory::validateCodecString` (validates a full codec expression string without a column type through `validateCodecAndGetPreprocessedAST`) and enforce the gate at the two user-facing entry points: CREATE in `registerStorageMergeTree` (skipped for `ATTACH`/`SECONDARY_CREATE`/load, so existing tables remain loadable, mirroring the column-codec gate) and `ALTER TABLE ... MODIFY SETTING` in `MergeTreeData::checkAlterIsPossible` (initiator-side, with the query context; the metadata-apply path on replicas is not re-checked). Add a stateless regression test covering both entry points, the multi-codec case, and that a table created with the codec stays loadable across `DETACH`/`ATTACH` without the session setting. Co-Authored-By: Claude Fable 5 <[email protected]>
|
The |
…l-definition ATTACH too A full-definition `ATTACH TABLE t UUID '...' (...) ENGINE = MergeTree ... SETTINGS default_compression_codec = 'ZXC'` is CREATE-like user input but runs under `LoadingStrictnessLevel::ATTACH`, so the previous `args.mode <= LoadingStrictnessLevel::CREATE` condition let it bypass `allow_experimental_codecs`. Now the gate also applies when `args.mode == LoadingStrictnessLevel::ATTACH` and the definition is fresh user input (`!attach_short_syntax`). Definitions read back from stored metadata (short `ATTACH TABLE t`, `ATTACH DATABASE`, server restart) are marked with `attach_short_syntax` by `createTableFromAST` and remain loadable, as does `SECONDARY_CREATE` (`Replicated` DDL replay, `RESTORE`). Co-Authored-By: Claude Fable 5 <[email protected]>
|
The @groeneai, investigate the failure and provide a fix in a separate PR. If the fix is already in progress, link it here. |
|
Confirmed: same signature as #110133 ( Fix already in progress: #109747 (OPEN, awaiting review). It adds an argument-type check in |
The gate on codec-valued MergeTree settings (`marks_compression_codec`, `primary_key_compression_codec`, `default_compression_codec`) was keyed to operation type, so values inherited from the current `<merge_tree>` config defaults could still introduce an experimental codec (e.g. `ZXC`) into existing tables without `allow_experimental_codecs`: - On load (server restart, short `ATTACH`), the check was skipped entirely, although a table that stores no codec settings falls back to the current config defaults. - `ALTER TABLE ... RESET SETTING` was not inspected by `MergeTreeData::checkAlterIsPossible` (only `MODIFY_SETTING` was), while `changeSettings` rebuilds the value from `getDefaultSettings`. Key the load-path exemption to "value stored in the table's own `SETTINGS` clause" instead: stored values were gated when introduced and remain loadable, while values inherited from current config defaults are validated even on load (at startup against the default profile, which is where an operator can legitimately opt in to such a config default). `FORCE_RESTORE` keeps skipping all sanity checks. Also gate `RESET SETTING` against the post-reset default value. Add an integration test covering CREATE/ATTACH/RESET with a `ZXC` config default, the stored-metadata exemption, and a restart.
|
@groeneai, investigate the failure: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=111007&sha=472b806e1820703eafeb6fb2dcd4e928bb482baf&name_0=PR&name_1=Integration%20tests%20%28amd_tsan%2C%204%2F6%29 and provide a fix in a separate PR. If the fix is already in progress, link it here.
The other red, |
|
Acknowledged. Confirmed both are replication races in ReplicatedAccessStorage / ZooKeeperReplicator: empty SHOW GRANTS right after a replicated GRANT, and ACCESS_ENTITY_ALREADY_EXISTS in ZooKeeperReplicator::updateZooKeeper on ALTER USER ... RENAME. These are distinct from the earlier UNKNOWN_ROLE cache-eviction race (#106521), which was fixed by #107097 (merged) with the regression test added in #106525. No fix is currently in progress for these two symptoms and there is no tracking issue yet. CIDB shows them PR-only over the last 30 days (0 on master), concentrated in the #106525 test-tuning runs plus this one amd_tsan hit. Investigating now; I will follow up here with a separate fix PR (or my findings). |
|
Fix PR: #111239 Both failures are one test bug in
The server side is behaving correctly (the rename collision check and eventual-consistency propagation are both by design), so the fix is test-only: read the grant back with |
LLVM Coverage Report
Changed lines: Changed C/C++ lines covered: 44/45 (97.78%) · Uncovered code |
|
Shall be merged before 26.7. |
Backport #111007 to 26.7: Mark the ZXC codec as experimental
| metadata.settings_changes = args.storage_def->settings->ptr(); | ||
| } | ||
|
|
||
| /// The codec-valued MergeTree settings accept an arbitrary codec expression and are applied without |
There was a problem hiding this comment.
@groeneai This is the wrong place for such checks. Please move it into MergeTreeSettingsImpl::sanityCheck (file: src/Storages/MergeTree/MergeTreeSettings.cpp).
There was a problem hiding this comment.
Acknowledged. I will move the experimental-codec gate out of registerStorageMergeTree.cpp into MergeTreeSettingsImpl::sanityCheck (src/Storages/MergeTree/MergeTreeSettings.cpp) in a separate PR, since this one is already merged, and follow up here with the link.
There was a problem hiding this comment.
Done in #111700: the CREATE-time check now lives in MergeTreeSettingsImpl::sanityCheck, next to the existing lossy-codec validation of the same three settings. The metadata-load paths that don't run sanityCheck (short/full ATTACH, SECONDARY_CREATE, config-default-on-load) keep a minimal counterpart in registerStorageMergeTree, now placed after the syntax branches so it covers both extended and deprecated syntax.
test_grant_revoke_replicated read the grant back from node2 with a bare, un-retried query (the only cross-replica read in the file without a retry). ReplicatedAccessStorage replicates the grant to node2 asynchronously, so a fast read can observe stale state and return empty grants. When that assert failed, the test aborted before dropping theuser2, leaking the user into the next test, whose ALTER USER ... RENAME TO theuser2 then hit the leftover entity with ACCESS_ENTITY_ALREADY_EXISTS. So both amd_tsan failures reported on ClickHouse#111007 stem from this one test bug, not a server bug. Read the grant back with assert_eq_with_retry, and drop theuser2 / restore the profile in a finally block so nothing can leak into later tests. Co-Authored-By: Claude Opus 4.8 <[email protected]>
The AST fuzzer with UBSan found that `CREATE QUOTA ... MAX execution_time = <huge number>`
casts an out-of-range double to `QuotaValue` (UInt64) in `parseMaxValue`
(`src/Parsers/Access/ParserCreateQuotaQuery.cpp:166`): the value is multiplied by the
quota type's output denominator (`execution_time` is stored in nanoseconds) without a
range check, which is undefined behavior:
runtime error: 1.84467e+19 is outside the range of representable values of type 'unsigned long'
Bound the scaled value to the UInt64 range before the cast and throw a `BAD_ARGUMENTS`
exception for out-of-range, negative, or non-finite values, mirroring the existing
guard for the quota interval duration. Apply the same guard to
`QuotaTypeInfo::stringToValue`, which had the identical unchecked cast (reachable from
quotas defined in the users configuration).
Found by the AST fuzzer in an unrelated PR:
https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=111007&sha=edff5021176b8081847ac3b4c6672f4089ad1ead&name_0=PR&name_1=AST%20fuzzer%20%28arm_asan_ubsan%29
Related PR: #111007
Co-Authored-By: Claude Fable 5 <[email protected]>
…mental Mark the ZXC codec as experimental
The
ZXCcodec was added in #110620 but, unlike the other recently added codecs (ALP,SZ3), it was not placed in the experimental category. This follow-up marks it experimental so that using it requiresSET allow_experimental_codecs = 1, matching the convention for new codecs that are not yet meant for production use.CompressionCodecZXC::isExperimentalnow returnstrue, so the codec is rejected withBAD_ARGUMENTSunlessallow_experimental_codecsis enabled, andsystem.compression_codecsreports it as experimental.04545_zxc_codecenables the setting and adds a negative case asserting the codec is rejected without it.ALPandSZ3.During review it turned out the codec-valued MergeTree settings (
marks_compression_codec,primary_key_compression_codec,default_compression_codec) bypassed the experimental-codec gate entirely, so this PR also closes those holes:CREATE TABLE ... SETTINGS default_compression_codec = 'ZXC'(and the other two settings) is validated againstallow_experimental_codecs, including full-definitionATTACH TABLE t UUID '...' (...), via the newCompressionCodecFactory::validateCodecString.ALTER TABLE ... MODIFY SETTINGandALTER TABLE ... RESET SETTINGare validated inMergeTreeData::checkAlterIsPossibleon the initiator with the query context (RESETagainst the post-reset value from the current<merge_tree>config defaults).<merge_tree>config defaults are validated even when loading a table (server restart, shortATTACH), because a table that stores no codec settings falls back to them; values stored in the table's ownSETTINGSclause were gated when introduced and remain loadable. At startup the check runs against the default profile, which is where an operator can legitimately opt in to such a config default.04616_experimental_codec_in_merge_tree_settings,04617_experimental_codec_attach_full_definition, and integration testtest_experimental_codec_config_default(config default + CREATE/ATTACH/RESET SETTING/restart).ZXChas not appeared in a stable release yet (it was merged intomasterin #110620), so this change simply adjusts the gating of the unreleased feature before it ships; the codec's changelog entry from #110620 already covers it.Related: #110620
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Documentation entry for user-facing changes
Version info
26.7.2.1