Skip to content

Stop 05227_storage_settings_unknown_name pinning where a SETTINGS reset is stored - #121163

Merged
alexey-milovidov merged 1 commit into
ClickHouse:masterfrom
groeneai:groeneai/05227-decouple-from-settings-split
Sep 20, 2026
Merged

alexey-milovidov merged 1 commit into
ClickHouse:masterfrom
groeneai:groeneai/05227-decouple-from-settings-split

Conversation

@groeneai

@groeneai groeneai commented Sep 20, 2026 •

Copy link
Copy Markdown
Collaborator

Changelog category (leave one):

  • CI Fix or Improvement (changelog entry is not required)

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

Not required (test-only change).

Description

05227_storage_settings_unknown_name is mine (#120898) and has been red on master in 12+ stateless flavours since #118423 merged. CI report

The test asserts which SETTINGS names the File/URL/S3/Log-family check rejects. Three of its expected lines also pinned, through a full SHOW CREATE TABLE echo, where an accepted name = DEFAULT query-setting reset ends up in the stored clause. df3cad127e7e of #118423 deliberately moved that: a second loop over ASTSetQuery::default_settings in InterpreterSetQuery::applySettingsFromQuery applies such a reset to the query context and erases it from the clause. The stale expectation is mine.

That placement already has a test which travels with the behaviour: 05099_create_database_with_inline_disk, added by #118423, pins the hoisted clause plus a system.query_log read-back proving the reset reaches the context. 05227 pinned it a second time from a file that does not travel with it; the revert #121144 correctly deletes 05099, and would leave 05227 behind.

So the three affected read-backs now assert what this test is about: the CREATE was accepted, the table exists, and the engine setting survived the split. Every CREATE statement is unchanged and every serverError UNKNOWN_SETTING arm untouched. Full-echo accept coverage of the default_settings payload moves to the one route where the split never runs, CREATE ... AS SELECT. Asserting a projection of system.tables.create_table_query instead of diffing a full echo is the established in-tree shape for this (05071_alter_constraint_array_join_no_op, 05136_alter_modify_setting_default).

It is green in both worlds, measured rather than argued: against master, and against a build with df3cad127e7e reverted in the working tree. Pristine test: FAIL on master, OK reverted. This change: OK on both, so it unblocks master now and costs nothing if #121144 lands.


Workflow [PR]
Sync PR [sync-upstream/pr/121163]

Version info

  • Merged into: 26.10.1.289-master (included in 26.10 and later)

…et is stored

This test asserts which SETTINGS names the File/URL/S3/Log-family check
rejects. Three of its expected lines also pinned, through a full
`SHOW CREATE TABLE` echo, *where* an accepted `name = DEFAULT` query-setting
reset ends up in the stored clause. That placement is decided by the SETTINGS
split, not by the check, and commit df3cad1 of ClickHouse#118423 moved it: a
second loop over `ASTSetQuery::default_settings` in
`InterpreterSetQuery::applySettingsFromQuery` now applies such a reset to the
query context and erases it from the clause, and the clause is pruned only
when `changes`, `default_settings` and `query_parameters` are all empty (it
was pruned on `changes.empty()` alone).

The placement already has a test that travels with the behaviour:
`05099_create_database_with_inline_disk`, added by ClickHouse#118423, pins the hoisted
clause plus a `system.query_log` read-back proving the reset reaches the
context. 05227 pinned it a second time, in a file that does not travel with
it, which is the defect here.

So the three affected read-backs now assert what this test is about: that the
`CREATE` was accepted, that the table exists, and that the engine setting
survived the split. Every `CREATE` statement is unchanged, so each world's
coverage of the check is preserved, and every
`-- { serverError UNKNOWN_SETTING }` assertion is untouched. Full-echo accept
coverage of the `default_settings` payload moves to the one route where the
split does not run at all, `CREATE ... AS SELECT`, which returns through
`if (create_query->select)` before either loop.

The result is correct with and without df3cad1, verified against both a
master build and a build with that commit reverted in the working tree.

Three comments that made split-dependent claims are rewritten.

Co-Authored-By: Claude Opus 5 <[email protected]>
@groeneai groeneai added can be tested Allows running workflows for external contributors groeneai-origin-ci-master PR origin: master/nightly CI monitoring finding labels Sep 20, 2026
@groeneai

Copy link
Copy Markdown
Collaborator Author
Internal second-model review: adjudication log (click to expand)

Pre-publication review by an independent model (engine: codex; 0 findings), plus my own cold review of
the resulting test files (3 nits, no blocker, no major). Bounded: 1 full pass, 0 fix rounds.

# Sev Finding Verdict Evidence / action
1 💡 The pre-PR validation gate comment said "17 serverError UNKNOWN_SETTING arms"; the file has 19 AGREE, corrected before posting grep -c gives 19 at this head and 19 at the base, so "untouched" held and only the count was wrong
2 💡 LIKE leaves _ unescaped, so %SETTINGS format_csv_delimiter = ';'% is looser than intended Noted, not blocking No setting name matches the wildcard at that position, and the unescaped form is the in-tree shape (05071_alter_constraint_array_join_no_op.sql:28)
3 💡 Three expected lines become a bare 1, less self-documenting than the echo they replace Noted, not blocking Position in the reference disambiguates them, and six full SHOW CREATE TABLE echoes remain in the file

Re-derived independently rather than taken from the change: df3cad127e7e leaves the
if (create_query->select) branch of InterpreterSetQuery::applySettingsFromQuery byte-identical, so
the added CREATE ... AS SELECT case is split-independent by construction and not only by measurement;
the storage check's own predicate is the exact complement of the hoist, so no rejection arm can change
behaviour; all 19 error arms and all 9 read-backs were re-classified against both prune conditions, and
none is world-sensitive; a carrier sweep run from scratch returns 05099_create_database_with_inline_disk
as the only other carrier, which is the reason this change is the right one.

Severity: ❌ blocker / ⚠️ major / 💡 nit. DISAGREE verdicts carry recorded evidence and are terminal
per finding.

Session id: cron:clickhouse-review-slot-9:20260920-082000

@groeneai

Copy link
Copy Markdown
Collaborator Author
Pre-PR validation gate (click to expand)
# Question Answer
a Deterministic repro? Yes. clickhouse-test 05227_storage_settings_unknown_name fails 1/1 on the unfixed tree with a byte-exact 3-line diff. CI's own in-job diagnosis: 246/246 failed with the run's random settings, 261/261 without.
b Root cause explained? Yes. df3cad127e7e added a second loop over ASTSetQuery::default_settings to InterpreterSetQuery::applySettingsFromQuery, which applies a query-setting name = DEFAULT reset to the context and erases it from the clause, and widened the prune condition from changes.empty() to all three payloads empty. So SHOW CREATE TABLE no longer echoes an accepted reset.
c Fix matches root cause? Yes. The stale artifact is this test's over-specification, not the server: it pinned where the split stores a reset, which 05099_create_database_with_inline_disk (added by #118423) already pins with a system.query_log read-back. No widened bound, no no-random-* tag, no size reduction, no deleted case; every CREATE statement is byte-for-byte unchanged.
d Test intent preserved / new tests added? Yes, and strengthened. All 19 serverError UNKNOWN_SETTING arms untouched. The three affected read-backs still assert acceptance, table existence and engine-setting survival. One case added that restores full-echo accept coverage of the default_settings payload on the split-independent CREATE ... AS SELECT route.
e Both directions demonstrated? Yes, in both worlds, on Build-ID-asserted binaries: on master the pristine test FAILs and this change is OK; with df3cad127e7e reverted in the working tree the pristine test is OK, this change is OK, and the alternative "update the reference" patch FAILs.
f Fix is general across code paths? Yes. No other 0_stateless test puts a = DEFAULT reset or a param_x entry in a storage clause (04337's hit is DEFINER = default); zero hits in tests/integration, 1_stateful and docs. 05099 and 04666 were repaired inside #118423 itself and are untouched here. CREATE DATABASE carries the same split and is covered by 05099, deliberately out of scope. Carriers 05227/05228/05229/05099/04666: 5/5 OK.
g Fix generalizes across inputs (params/datatypes/wrappers)? The three SETTINGS payloads each stay covered: changes (custom_x = 1), default_settings (two = DEFAULT accept cases, the new AS SELECT reset case, the not_a_setting_at_all = DEFAULT error arms), query_parameters (two param_x = 1 error arms plus the AS SELECT one). Engines: File, URL, S3/COSN/OSS/GCS, AzureBlobStorage, HDFS, Log/TinyLog/StripeLog, MergeTree. No type-wrapper dimension: the subject is SETTINGS names, not values.
h Backward compatible? (maintainer-approved exception only) N/A. Test-only: no setting default moves, no SettingsChangesHistory.cpp entry, no format versioning, no production code path touched.
i Invariants and contracts preserved? Yes. No src/ change. The test's own invariant (an unknown SETTINGS name is rejected for these engines, in all three payloads) is unchanged. The new LIKE read-backs are mutation-proven non-vacuous in both legs: a pattern naming an absent setting prints 0, and a genuinely unknown payload name makes the CREATE throw UNKNOWN_SETTING.

Session id: cron:clickhouse-impl-slot-5:20260920-075200

@clickhouse-gh clickhouse-gh Bot closed this Sep 20, 2026
@clickhouse-gh clickhouse-gh Bot reopened this Sep 20, 2026
@clickhouse-gh

clickhouse-gh Bot commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [51e07b3]

Summary: ✅


AI Review

Summary

This PR narrows 05227_storage_settings_unknown_name back to the invariant the test is supposed to own: which storage SETTINGS names are rejected as unknown. The new assertions stop pinning the split-dependent placement of accepted query-setting resets, but they still keep table-level coverage for acceptance, engine-setting persistence, and the unsplit CREATE ... AS SELECT path. I did not find a correctness or test-coverage regression in the current diff, and the PR CI linked from the PR is all green.

Final Verdict

✅ No findings.

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Sep 20, 2026
@clickhouse-gh clickhouse-gh Bot added the comp-testing Test content only (no production code). label Sep 20, 2026
@alexey-milovidov
alexey-milovidov added this pull request to the merge queue Sep 20, 2026
@alexey-milovidov alexey-milovidov self-assigned this Sep 20, 2026
Merged via the queue into ClickHouse:master with commit 1d7d23f Sep 20, 2026
176 of 349 checks passed
@robot-clickhouse-ci-1 robot-clickhouse-ci-1 added the pr-synced-to-cloud The PR is synced to the cloud repo label Sep 20, 2026
@clickhouse-gh clickhouse-gh Bot added comp-ddl DDL command coordination and execution (ON CLUSTER, DDL queue). and removed comp-testing Test content only (no production code). labels Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors comp-ddl DDL command coordination and execution (ON CLUSTER, DDL queue). groeneai-origin-ci-master PR origin: master/nightly CI monitoring finding pr-ci pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants