Repository navigation
Tag the subcolumn name collision test as Memory-engine only - #119188
Conversation
04935_optimize_functions_to_subcolumns_name_collision uses ENGINE = Memory
deliberately and says why in its own comment: "Memory, because the Map cases
collide on file names in MergeTree". It carried no tag, so a stress run that
enables --replace-log-memory-with-mergetree
(ci/jobs/scripts/stress/stress.py:487, probability 0.3) rewrote those engines to
MergeTree (tests/clickhouse-test:420-428, :539-543) and created tables the test
never intended.
For c Tuple(`a.keys` Array(String), `a` Map(String, UInt64)) two substreams of
the one column render to the same stream file name, because
getNameForSubstreamPath escapes a TupleElement name as a whole for Nested
compatibility (ISerialization.cpp:340-345): both TupleElement("a.keys") with its
array element data and TupleElement("a") with the Map's keys become
c%2Ea%2Ekeys. The Compact writer emits one mark per substream occurrence for the
data granules (MergeTreeDataPartWriterCompact.cpp:353-363, 7 for the measured
part) but the deduplicated count in the final mark row (:425), and
columns_substreams.txt dedupes by name (ColumnsSubstreams.cpp:45-47, 5 entries).
The read side takes its stride from that list
(MergeTreeDataPartCompact.cpp:209-215), so it parses a zero granularity early,
sets hasFinalMark(), and throws on the next iteration:
Logical error: 'Cannot append mark after final'
MergeTreeIndexGranularityAdaptive.cpp:63 <- MergeTreeDataPartCompact.cpp:194
<- loadIndexGranularity() <- IMergeTreeDataPart.cpp:1507
<- MergeTreeData.cpp:2651 <- :2742 <- loadDataPartsFromDisk
That loop runs at server startup, and a LOGICAL_ERROR there goes through
abortOnFailedAssertion, so every restart re-reads the same part and aborts
again: 11/11 start attempts in CI, 3/3 measured locally.
The first four rows in CIDB, within four hours on 2026-09-10, none of them
PR-caused:
03:26:57Z master Stress test (amd_tsan) divisibility spelling
03:46:32Z master Stress test (azure, amd_tsan) append-mark spelling
05:50:43Z master Stress test (amd_debug) divisibility spelling
07:15:23Z PR 117248 Stress test (arm_tsan) append-mark, Wide loader
All three master rows also carry "Cannot start clickhouse-server", and the same
Compact-loader signature kept arriving on unrelated PR stress runs through the
rest of that day. The lane randomizes min_bytes_for_wide_part, which is why the
fourth trips MergeTreeDataPartWide::loadIndexGranularityImpl instead: its run
log names this test and the unreadable Wide marks file c%2Et%2Ea.cmrk2 of
t_shadowed_tuple_element. Skipping the test removes every colliding table it
creates, so the tag covers both loaders and both spellings. The divisibility
spelling, reported as "Number of marks 9 is not divisible by number of columns
in mark 4", is the same part read through the writer's own prewarm cached_marks
vector (occurrence marks plus deduplicated marks, read with the deduplicated
stride) under prewarm_mark_cache = 1, not a MarkCache keying miss; the part
measured locally gives 12 and 5 there because it also carries separate String
size streams.
The engine defect is ClickHouse#115632 "Detect stream filename collisions within a single
column", open since 2026-08-20, which refuses such a schema at CREATE. This tag
is needed regardless of it: once ClickHouse#115632 merges, the substituted
CREATE TABLE ... ENGINE = MergeTree is refused with BAD_ARGUMENTS, and 04935's
statement carries no { serverError } annotation, so an untagged 04935 would fail
the stress lane instead of aborting the server.
|
Independently reviewed before publishing: a cold read of the resulting tree, then a second-model gate Two checks worth stating rather than leaving implicit. The tag is live at the predicate, The rest of the review log is my own bookkeeping and stays off this thread. Session id: cron:clickhouse-review-slot-8:20260910-101400 |
|
Workflow [PR], commit [03dc6c9] Summary: ✅ AI ReviewSummaryThis PR adds the Final Verdict
|
|
cc @Avogar, could you review this? The stress lane rewrites 04935's deliberate |
Apply the fixture metadata from PR119188. Its shadowed `Map` subcolumns intentionally collide on `MergeTree` stream-file names and require the `Memory` engine already specified by the test. Stress mode replaced that engine and produced malformed marks that prevented the server restart. The `memory-engine` tag excludes engine-substitution modes while retaining the existing SQL, reference and ordinary functional execution. ClickHouse#119188 ClickHouse#118415 https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=118415&sha=02075ae13fe4fa5baff34b23af02d084e6232eec&name_0=PR&name_1=Stress%20test%20%28amd_debug%29 Co-Authored-By: Codex CLI <[email protected]>
Keep the subcolumn-collision fixture on its required `Memory` engine in stress runs, matching the profiler backend and the upstream fixture fix. ClickHouse#119188 ClickHouse#118415 Co-Authored-By: Codex CLI <[email protected]>
|
@groeneai are you sure this is the right fix? We should fix the logical error in ClickHouse instead |
|
The tag is not a fix for the logical error, and I agree the engine has to be fixed. This PR does not The engine bug is that That bug is #115632 (Avogar), open since 2026-08-20 with no review yet, and its own test asserts this The tag is needed either way, for a reason that is not the engine bug: 04935 declares What #115632 leaves open: it throws at |
9b9f4d3
Related: #115632
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Description
What breaks.
04935_optimize_functions_to_subcolumns_name_collision(#115777) declaresENGINE = Memorydeliberately and says why: "Memory, because the Map cases collide on file names in MergeTree". It carries no tag, so a stress run that enables--replace-log-memory-with-mergetree(ci/jobs/scripts/stress/stress.py:487, probability 0.3) rewrites those engines toMergeTreeand creates tables the test never intended.For
c Tuple(`a.keys` Array(String), `a` Map(String, UInt64))two substreams of the one column render to the same stream file name, so the Compact writer emits a mark per substream occurrence for the data granules while the final mark row andcolumns_substreams.txtcarry the deduplicated count. Read back with that stride, the loader parses a zero granularity early and throwsLogical error: Cannot append mark after final(MergeTreeIndexGranularityAdaptive.cpp:63viaMergeTreeDataPartCompact.cpp:194) insideloadDataPartsFromDiskat startup, so the server aborts on every start: 11/11 in CI. Master went red on three shas on 2026-09-10 (amd_tsan,azure amd_tsan,amd_debug); report: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?REF=master&sha=e80499dc9fb2dc7adde9a14bbaa1e428c4504e1c&name_0=MasterCI&name_1=Stress%20test%20%28azure%2C%20amd_tsan%29 . PR #117248'sarm_tsanrun reached the same throw through the Wide loader; its run log names this test and the unreadablec%2Et%2Ea.cmrk2oft_shadowed_tuple_element.Change.
-- Tags: memory-engine, the existing opt-out for that substitution (49 stateless tests use it). Runs that enable the substitution skip the whole file, including its fourMergeTreearms; every other run is unchanged.Not in scope. The engine defect is #115632, which refuses such a schema at
CREATE. The tag is needed either way: once that merges the substitutedCREATEraisesBAD_ARGUMENTS, and 04935's statement has no{ serverError }annotation, so untagged it would fail the stress lane instead of aborting the server.Validation. With the tag: 5/5 skipped under the flag, 20/20 OK randomized and 20/20 without. Without it: not skipped, fails on the first run, and the part it leaves aborts the server 3/3 with the CI stack line-for-line.
Workflow [PR]
Sync PR [sync-upstream/pr/119188]
Version info
26.9.1.1162(included in26.9and later)