Skip to content

Do not flatten a Set-engine array table on the right of IN - #110514

Open
groeneai wants to merge 14 commits into
ClickHouse:masterfrom
groeneai:fix-in-scalar-over-set-array-table-110505
Open

groeneai wants to merge 14 commits into
ClickHouse:masterfrom
groeneai:fix-in-scalar-over-set-array-table-110505

Conversation

@groeneai

@groeneai groeneai commented Jul 15, 2026 •

Copy link
Copy Markdown
Collaborator

Changelog category (leave one):

  • Bug Fix (user-visible misbehavior in an official stable release)

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

Fixed Code: 48. NOT_IMPLEMENTED: Method read is not supported by storage Set when a Set-engine table, or a Alias table pointing at one, is used on the right side of IN. Such tables are now always consumed as a prepared set instead of being read, in the analyzer, the legacy IN implementation, and the serialized-plan path. Closes #110505.

Description

Closes: #110505

A single-Array-column table on the right of IN is rewritten into a SELECT column FROM table subquery so its elements become the set elements. A Set-engine table matches that shape but has no read method: it is meant to be consumed natively as a prepared set. So the rewrite made IN over set-backed tables fail with Code: 48. NOT_IMPLEMENTED: Method read is not supported by storage Set.

The three places that decide "is this a set-backed table" each looked only at the immediate storage, so a Alias wrapper (whose read delegates to its target) was never recognized. This adds a shared helper, getSetStorageFromTable, that resolves through an alias chain and matches StorageSet including derived types, and routes all three call sites through it: the analyzer (Analyzer/Resolve/resolveFunction.cpp, Planner/CollectSets.cpp), the legacy implementation (Interpreters/ActionsVisitor.cpp, reached with enable_analyzer = 0), and plan deserialization (Processors/QueryPlan/SetsSerialization.cpp, reached in distributed-plan execution).

Reproduces on released versions, so this is not master-only:

CREATE TABLE t (arr Array(UInt8)) ENGINE = Set;
INSERT INTO t VALUES ([1, 2, 3]);
CREATE TABLE a ENGINE = Alias('t');
SELECT [1, 2, 3] IN a;  -- 26.5/26.6/26.7: NOT_IMPLEMENTED; now 1
SELECT 2 IN t;          -- 26.7: NOT_IMPLEMENTED; now TYPE_MISMATCH

ENGINE = Alias is generally available in all three (allow_experimental_alias_table_engine is obsolete), and the same query over an Alias to a readable table always worked, so the failure was specific to set-backed targets.

Access checking is unchanged from before the rewrite: a set-backed alias on the right of IN requires the same grants as an equivalent Alias to a MergeTree table, verified across 5 grant combinations in both analyzer modes and on the serialized-plan path.

Regressions: 04512_in_function_array_subquery_right_argument (direct, alias, legacy mode, access) and 04652_in_set_alias_serialized_query_plan (serialized plan).

flattenArrayTableExpressionOnRightOfIn (added for x IN some_array_table)
rewrote any single-Array-column TableNode into a SELECT column FROM table
subquery. A Set-engine table matches that shape but has no read method and
is consumed natively as a prepared set, so the rewrite made the planner call
IStorage::read on it: scalar IN a Set of Array now threw
NOT_IMPLEMENTED: Method read is not supported by storage Set.

Skip the flatten for StorageSet, restoring the native prepared-set path
(the elements of a Set of Array are whole array rows: an array left argument
matches a row, a scalar left argument is a type mismatch, exactly as before
the array-table flattening was added). The commit that introduced the helper
already stated the StorageSet fast path must be unchanged; the guard was
missing.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@groeneai

Copy link
Copy Markdown
Collaborator Author
Pre-PR validation gate (click to expand)
# Question Answer
a Deterministic repro? Yes. SET enable_analyzer=1; CREATE TABLE t (arr Array(UInt8)) ENGINE=Set; INSERT INTO t VALUES([1,2,3]); SELECT 2 IN t; -> Code: 48 NOT_IMPLEMENTED: Method read is not supported by storage Set every time on master (build 1cdd7b0).
b Root cause explained? flattenArrayTableExpressionOnRightOfIn (f322da8, 2 days ago) rewrites a single-Array-column TableNode into SELECT column FROM table. StorageSet matches that shape but has no read and is consumed natively as a prepared set, so the planner calls IStorage::read on it -> NOT_IMPLEMENTED.
c Fix matches root cause? Yes. Skips the flatten for StorageSet so the native prepared-set path (Planner/CollectSets.cpp) handles it, matching the introducing commit's stated intent that the StorageSet fast path stay unchanged.
d Test intent preserved / new tests added? Yes. Feature (element flatten) still fires for readable tables; added a StorageSet regression guard (array-row membership + scalar { serverError TYPE_MISMATCH }) to 04512.
e Demonstrated both directions? Yes. Buggy binary (build 1cdd7b): scalar IN Set -> code 48. Fixed binary (build c52bf7): array IN Set -> 1 0, scalar IN Set -> code 53 TYPE_MISMATCH. Test .reference byte-identical match.
f Fix general, not narrow? Yes. The only read-less prepared-set storage reachable by this TableNode path is StorageSet; StorageJoin fails earlier on join-key typing and is not flattened into a readable subquery. Guard covers the whole read-less-prepared-set class this helper touches.
g Generalizes across inputs? Yes. Verified single/multi-row Set, array and scalar left arguments, and rewrite_in_to_join=0/1.
h Backward compatible? Yes. Restores pre-f322da8 (unreleased) StorageSet behavior; no released behavior changes, no setting/format changes.
i Invariants/contracts preserved? Yes. StorageSet keeps its native prepared-set contract (never read); the flatten helper's contract (only readable tables) is now honored.

Session id: cron:clickhouse-worker-slot-1:20260715-072400

@groeneai

Copy link
Copy Markdown
Collaborator Author

cc @novikd @vdimir - review please. flattenArrayTableExpressionOnRightOfIn (f322da8) rewrote a single-Array-column StorageSet into a SELECT-from-table subquery, but StorageSet has no read and is a native prepared set, so scalar IN over it threw NOT_IMPLEMENTED. This skips the flatten for StorageSet.

@clickhouse-gh

clickhouse-gh Bot commented Jul 15, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [17e0616]

Summary: ❌

job_name test_name status info comment
Stress test (amd_debug) FAIL
Logical error: Query context must be created after authentication (STID: 3197-391f) FAIL cidb
Stress test (arm_release) FAIL
Logical error: Query context must be created after authentication (STID: 3197-20e5) FAIL cidb
BuzzHouse (amd_debug) FAIL
Logical error: No thread group attached to the thread A (STID: 3358-2d6d) FAIL cidb

AI Review

Summary

This PR fixes IN over Set-engine tables and Alias wrappers by routing the analyzer, legacy IN, and serialized-plan rebuild through getSetStorageFromTable, and the OSS Set/Alias paths look coherent. I would still hold merge because the new alias-aware recognizer now makes Cloud SharedSet reachable in code paths that still use the wrong accessor.

Missing context / blind spots
  • ⚠️ I could not execute the Cloud-only SharedSet paths locally: this checkout builds with CLICKHOUSE_CLOUD = 0, and StorageSharedSetJoin.h is not present in the OSS tree. The source is still sufficient to spot the dead branch / context-free accessor, but an end-to-end repro would need the Cloud codebase.
Findings

❌ Blockers

  • [src/Planner/CollectSets.cpp:120-127,160-162; src/Processors/QueryPlan/SetsSerialization.cpp:224-228] [dismissed by author -- https://github.com/Do not flatten a Set-engine array table on the right of IN #110514#discussion_r3586917872] getSetStorageFromTable now recognizes derived StorageSets such as Cloud SharedSet through Alias wrappers, but the planner and deserializer still materialize them via plain StorageSet::getSet(). In CollectSets the only SharedSet branch is still inside the constant-literal arm, where storage_set and second_argument_table are null, so table-backed SharedSet never reaches the context-aware accessor; in SetsSerialization there is no SharedSet branch at all. That leaves IN alias_to_shared_set on Cloud on the wrong accessor path after this PR, and serialized-plan execution no longer even fails fast on SharedSet because the new helper makes that broken path reachable. Suggested fix: either keep the new helper from matching SharedSet until Cloud handling is fixed, or move the SharedSet dispatch into the real storage-backed branch and mirror it in makeSetsFromStorage.
Final Verdict

❌ Needs changes. I would merge the OSS Set/Alias fix once the Cloud SharedSet accessor path is corrected or explicitly excluded from the new alias-aware recognizer.

@clickhouse-gh clickhouse-gh Bot added the pr-not-for-changelog This PR should not be mentioned in the changelog label Jul 15, 2026
Switch the guard from typeid_cast (exact type) to dynamic_cast<const
StorageSet *> so the Cloud-only StorageSharedSet, which derives from
StorageSet, is also skipped by the array-table flatten and keeps the
native prepared-set path. The rest of the IN pipeline already treats
derived set storages as the same family via dynamic_cast (CollectSets,
ActionsVisitor), so the exact-type check was inconsistent.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@groeneai

Copy link
Copy Markdown
Collaborator Author

Good catch, done in d9b5d91. Switched the guard to dynamic_cast<const StorageSet *> (is-a) so the Cloud-only StorageSharedSet, which derives from StorageSet, is also skipped by the array-table flatten and keeps the native prepared-set path. This matches the rest of the IN pipeline (Planner/CollectSets.cpp, Interpreters/ActionsVisitor.cpp both use dynamic_cast).

SharedSet is not registered in OSS (CREATE TABLE ... ENGINE = SharedSet returns UNKNOWN_STORAGE), so a SharedSet regression is not reachable in a stateless test. The plain StorageSet case in 04512_in_function_array_subquery_right_argument.sql exercises the same code path.

Pre-PR validation gate (click to expand)
# Question Answer
a Deterministic repro? Yes. CREATE TABLE t (arr Array(UInt8)) ENGINE=Set; INSERT ... VALUES ([1,2,3]); SELECT 2 IN t threw Code 48 NOT_IMPLEMENTED on the introducing commit.
b Root cause explained? flattenArrayTableExpressionOnRightOfIn rewrote any single-Array-column TableNode into SELECT column FROM table; a Set table matches that shape but is consumed natively as a prepared set and has no read(), so the planner hit IStorage::read -> NOT_IMPLEMENTED. The exact-type typeid_cast guard also missed derived StorageSharedSet (Cloud).
c Fix matches root cause? Yes. Skip the flatten for any StorageSet (is-a), so both OSS Set and Cloud SharedSet keep the native prepared-set path.
d Test intent preserved? Yes. The 04512 test still asserts array-row membership on a Set table plus the scalar TYPE_MISMATCH guard; no assertion weakened.
e Demonstrated both directions? Yes. Pre-fix: Code 48. Post-fix: [1,2,3] IN t -> 1, scalar 2 IN t -> Code 53 TYPE_MISMATCH (honest pre-feature behavior).
f Fix general, not narrow? Yes. dynamic_cast covers the whole StorageSet hierarchy incl. StorageSharedSet, matching CollectSets/ActionsVisitor.
g Generalizes across inputs? Yes. Array-row match and scalar mismatch verified; readable tables (Memory, subquery) still flatten as intended.
h Backward compatible? Yes. Fixes unreleased code (introducing commit f322da8, not in any release); restores pre-feature behavior for Set tables.
i Invariants preserved? Yes. Native prepared-set consumption of Set/SharedSet is preserved; no other table type affected.

Session id: cron:clickhouse-worker-slot-1:20260715-095000

A StorageSet reached through ENGINE=Alias('set_table') was not recognized as a
set-backed table on the right of IN. The analyzer guard and the planner both used
an exact/dynamic_cast check on the immediate storage, so the alias wrapper (whose
read delegates to the target) was flattened into a SELECT column FROM table
subquery, and the fallback plan then read through the alias into StorageSet::read,
reproducing NOT_IMPLEMENTED: Method read is not supported by storage Set.

Add a shared getSetStorageFromTable helper that unwraps a StorageAlias chain to
its target and matches StorageSet (including derived set storages), and use it in
both resolveFunction (analyzer) and CollectSets (planner), so a set-backed table
is consumed natively as a prepared set through any alias wrapping.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@groeneai

Copy link
Copy Markdown
Collaborator Author

Confirmed and fixed in d1671b9.

Reproduced on the prior build: CREATE TABLE s (arr Array(UInt8)) ENGINE=Set; INSERT INTO s VALUES ([1,2,3]); CREATE TABLE a ENGINE=Alias('s'); SELECT [1,2,3] IN a threw NOT_IMPLEMENTED: Method read is not supported by storage Set, while [1,2,3] IN s returned 1. The analyzer does not unwrap StorageAlias (only StorageMaterializedView is), so the guard's cast on the immediate storage was null and the alias got flattened, then read through into StorageSet::read.

Added a shared helper getSetStorageFromTable(storage) in StorageSet.h/.cpp that walks a StorageAlias chain to its target and matches StorageSet (including derived set storages), and used it in both resolveFunction.cpp and Planner/CollectSets.cpp. After the fix, an aliased set behaves exactly like the direct Set table: [1,2,3] IN a = 1, [9,9,9] IN a = 0, 2 IN a = the same TYPE_MISMATCH. Regression added to 04512 (fails before / passes after).

Note: alias-to-alias chains are rejected at CREATE time (BAD_ARGUMENTS), so the depth-bounded walk is defensive only.

Comment thread src/Planner/CollectSets.cpp Resolved
@groeneai

Copy link
Copy Markdown
Collaborator Author

CI finish ledger — d1671b9

All failures on this commit are the single ongoing infra runner outage; none are caused by this PR's diff. Every failure has an owner.

Check / test Reason Owner / fixing PR
Stateless tests (amd_asan_ubsan, distributed plan, parallel) / many unrelated tests infra (one broken-runner window: 124 unrelated PRs / 10852 hits across hundreds of unrelated tests on this exact check in 12h; not reproducible) a fix task is tracking this runner outage (fixing-PR link to follow)
Finish Workflow / Post Hooks rollup of the above same infra owner
CH Inc sync - CH Inc sync (private, not actionable)

Session id: cron:our-pr-ci-monitor:20260715-153000

Comment thread src/Storages/StorageSet.h Resolved
… paths

The shared getSetStorageFromTable helper resolves a set-backed table through
StorageAlias wrappers, and the analyzer and the planner already use it. Two other
consumers still tested the immediate storage, so `x IN alias_to_set` remained broken
in both of them:

- src/Interpreters/ActionsVisitor.cpp: the legacy IN implementation resolved the table
  itself and only checked `dynamic_cast<StorageSet *>` / `dynamic_cast<StorageSharedSet *>`
  on it, so with `enable_analyzer = 0` the alias fell through to the ordinary table-read
  path and threw `NOT_IMPLEMENTED: Method read is not supported by storage Set`.
- src/Processors/QueryPlan/SetsSerialization.cpp: makeSetsFromStorage rebuilds a
  storage-backed set from its table name after a plan is deserialized, using
  `typeid_cast<const StorageSet *>`. On the serialized-plan path (distributed-plan
  execution) the alias therefore threw `INCORRECT_DATA: Table ... is not a StorageSet`
  instead of reusing the prepared set.

Both now go through the helper, so a set-backed table is never read on the right of IN
regardless of the analyzer setting or of whether the plan was serialized. The Cloud
SharedSet branch in ActionsVisitor keeps its behavior: the helper matches derived set
storages too, and the name check selects the context-aware getSet overload, mirroring
what Planner/CollectSets already does.

Both sites were confirmed on the previous PR head (prebuilt amd_debug 4e57ec6, build id
ebfd7955) with the exact errors above, and both are fixed by this commit (build id
71e0e9b8). Reverting either hunk alone reddens only its own regression, so each is
load-bearing and they are independent.

Regressions: the legacy-analyzer spelling extends 04512, and the serialized-plan
spelling is a new two-shard test 04652.
@groeneai

Copy link
Copy Markdown
Collaborator Author

CI finish ledger - 4e57ec6

Every failure below has an owner: a fixing PR, or a full-effort fix task whose
fixing-PR link will be posted here when it opens.

Check / test Reason Owner / fixing PR
Stateless tests (amd_llvm_coverage, ParallelReplicas, s3 storage, parallel) / 01666_merge_tree_max_query_limit flaky on this lane: secondary replicas are built without setQueryId, so the per-table max_concurrent_queries throttle sees several random query ids for one statement and the query competes against itself #112385 (ours, open)
Integration tests (amd_msan, 1/8) / test_postgresql_replica_database_engine/* (9 tests, one event) server death cascades the whole module - every row is Code: 210 Connection refused raised inside the autouse setup_teardown fixture, so this is ONE event, not N test failures a fix task is created (investigating at full effort - fixing-PR link to follow here)

Session id: cron:our-pr-ci-monitor:20260729-083000

groeneai added 2 commits July 29, 2026 08:58
getSetStorageFromTable returned a raw StorageSet *. For a direct StorageSet that is fine,
because the caller already holds the StoragePtr it passed in. Through a StorageAlias it is
not: the target comes from alias->tryGetTargetTable(), which returns a fresh shared_ptr,
and the only owner was the helper's own local. Context::getOrCacheStorage caches StorageID
values, not StoragePtr, so nothing on the caller side kept the target alive; its lifetime
rested on the database's tables map instead of on the caller.

Return std::shared_ptr<StorageSet> so the caller shares ownership of whatever it is about
to call getSet on, and update the four call sites. The two Cloud SharedSet branches take
.get() for their static_cast, which keeps their behavior unchanged.

Found by the second-model review of the previous commit.
…h an Alias

Reading a table through an Alias checks SELECT on the target: StorageAlias::read
resolves it with getTargetTable(TargetAccess{context, AccessType::SELECT, ...}).
Consuming a set-backed target as a prepared set on the right of IN replaces that
read, so it has to require the same grant.

Recognizing the set-backed table through the alias made three prepare paths
resolve the target with the unchecked tryGetTargetTable and consume it without
entering StorageAlias::read, so a user granted SELECT on the alias only could
read the target set. On pristine master the analyzer spelling was ACCESS_DENIED,
so the check had to be restored, not introduced.

getSetStorageFromTable now takes an optional context and, when given one,
resolves an alias with the same SELECT check that reading it performs. The three
consuming callers (the planner, the legacy IN implementation and the
serialized-plan reconstruction) pass the query context. The analyzer call site
only asks whether the table is set-backed before deciding not to rewrite it into
a subquery, and does not consume it, so it passes no context and stays a pure
recognizer.

Reading a set-backed table directly through IN has never checked SELECT on it,
on master or before this change. That is a pre-existing, engine-wide question
about the direct spelling and is left alone here.
@vdimir vdimir self-assigned this Jul 29, 2026

@vdimir vdimir left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why marked as 'Not for changelog'?

groeneai added 6 commits July 29, 2026 11:00
Reading through an alias requires SELECT on the alias and on the target: the
planner checks the alias in checkAccessRights and StorageAlias::read checks the
target. Consuming a set-backed target as a prepared set replaces both, so it has
to require both. Only the target check was there, so a user granted SELECT on the
target but not on the alias could use the alias, where an ordinary alias on the
right of IN is denied.

Measured against an equivalent MergeTree alias on the right of IN, across all
four grant combinations, both analyzer settings and the serialized plan. The two
now agree everywhere: alias only denied, target only denied, alias plus a
column-level target grant denied (a table-wide target grant is what both need),
both granted allowed.

The regression covers the target-only case and adds a cluster query with
serialize_query_plan = 1 for the deserialization path. Note the serialized case
is currently decided on the initiator, before the plan is sent: removing the
context from the planner call makes those rows pass, while removing it from
SetsSerialization alone does not, so the check there is defence in depth rather
than the deciding one.
… column

The helper is called for the table on the right of every IN, before anything
knows whether its target is set-backed, so checking while walking the alias chain
applied set semantics to aliases that resolve to something else. A user holding
column-level SELECT on an Alias to a Memory table could use it on the right of IN
and then could not, which the change had no business affecting.

The walk now resolves first and checks only once a StorageSet is found, so an
alias to anything else is left exactly as it was. The check is also column-scoped
over the target's columns instead of table-wide: the whole set is consumed, and
that is what an ordinary alias on the right of IN accepts, so a column-level grant
covering every column is now enough here too, and one that misses a column is not.

Compared against an equivalent MergeTree alias on the right of IN across five
grant combinations, both analyzer settings and the serialized plan, the two agree
in every cell: alias only denied, target only denied, alias plus a partial column
grant denied, alias plus a grant on all columns allowed, both table-wide allowed.
A set-backed table named directly still needs no grant, as before.
…cidable

The walk collected raw StorageAlias pointers and then advanced the only owning
StoragePtr to the next target, so nothing kept an intermediate alias of a chain
alive until the access check ran over it. Chains are reachable: an alias may be
created while its target does not exist yet, and that target may then be created
as another alias. Only the ids are needed, so the walk now stores those and holds
no pointer past the iteration that produced it.

The regression used a single-column Set, where a grant on one column and a grant
on every column are the same thing, so it could not tell the intended check from
one that looks at one column only. The set is now two columns and the test
distinguishes both directions, on the target and on the alias: a grant covering
every column is accepted, a grant missing one is denied. Checking only the first
column, or table-wide instead of by column, each makes it fail.
…cumentation

Wrap the class, function and SQL names in the comments this branch adds in inline
code blocks, as the repository asks for. Only lines added here are touched.

The helper documentation still said resolving through an alias requires `SELECT`
on the target, which stopped being the whole story once the alias itself is
checked too.
The plan is only serialized on the analyzer's remote path, and the runner
randomizes both `enable_analyzer` and `prefer_localhost_replica`, so `04652` could
draw a local or query-text plan and pass without ever rebuilding a set on a
receiving side. Both are now pinned, as they already were in `04653`.

Also say in `04653` what its serialized rows do and do not establish: both ends
check and the initiator checks first, so those rows assert the outcome, not which
end produced it. Giving the two ends different grants needs more than one node.
The three comment blocks this branch added restated the motivation that belongs in
the commit messages. Keep the part a reader needs at the call site: what the helper
returns and owns, which grants a consuming caller needs, and that a set-backed
table must not be rewritten into a subquery.
@groeneai

Copy link
Copy Markdown
Collaborator Author

Fixing PR for the test_postgresql_replica_database_engine Connection-refused cascade dispositioned to a fix task on this PR's CI finish ledger: #112381 (merged), with the re-land #112382.

Root cause: #109339 added a materialized_tables traversal to DatabaseMaterializedPostgreSQL::getTablesIterator. The asynchronous-metrics thread reaches that iterator (ServerAsynchronousMetrics.cpp:447, and this database reports isExternal() == false so it is not skipped) while stopReplication clears the same map holding only handler_mutex, never tables_mutex. That is a heap-use-after-free on the stored wrappers, it killed the server, and every remaining test in the module then failed inside the autouse setup_teardown fixture with Code: 210 Connection refused. One server death per job, not N independent flaky tests.

Timeline: #109339 merged 2026-07-28 13:16 UTC, the master cascade began the same evening, #112381 reverted it 2026-07-29 01:39 UTC. Every failing build contained the introducing commit and lacked the revert. True-master runs since the revert are clean: 0 failures against 6804 passing rows across 23 distinct commits. #112382 re-lands the feature with tables_mutex taken on all materialized_tables touch points, including the swap-and-destroy-outside-the-lock form in stopReplication.

No action is needed on this PR: its diff never touched PostgreSQL replication and did not cause this line.

@groeneai

Copy link
Copy Markdown
Collaborator Author

You are right, and my "not for changelog" was based on a wrong premise. I have changed the category to Bug Fix (user-visible misbehavior in an official stable release) and written the entry.

I had described this as unreleased-master-only, but the commit that introduced the rewrite (f322da8) is an ancestor of v26.7.1.1315-stable, and the alias spelling is broken further back than that. Measured on released binaries:

26.5 26.6 26.7
[1,2,3] IN alias_to_set NOT_IMPLEMENTED NOT_IMPLEMENTED NOT_IMPLEMENTED
[1,2,3] IN alias_to_set, enable_analyzer = 0 NOT_IMPLEMENTED NOT_IMPLEMENTED NOT_IMPLEMENTED
2 IN set_table TYPE_MISMATCH TYPE_MISMATCH NOT_IMPLEMENTED

So there are two released-version bugs here, not one: the array-table rewrite added the direct-spelling failure in 26.7, and the alias spelling has been failing since at least 26.5 because the three "is this set-backed" checks only ever looked at the immediate storage. ENGINE = Alias is generally available in all three (allow_experimental_alias_table_engine is obsolete), and the same query over an Alias to a Memory table returns 1 on all three, so the failure is specific to set-backed targets rather than to aliases.

One thing I cannot do myself: the pr-not-for-changelog label is still on the PR because I lack permission to change labels. The Config Workflow hook derives the label from the body category, so it should correct itself on the next run; otherwise it needs a maintainer.

I have not pushed anything, so your approval is untouched. Head is still 1338e9c.

@groeneai

Copy link
Copy Markdown
Collaborator Author

CI finish ledger - 1338e9c

Every failure below has an owner: a fixing PR (mine or external), or a full-effort fix task whose fixing-PR link will be posted here when it opens. Only CH Inc sync is exempt.

Check / test Reason Owner / fixing PR
Stateless tests (amd_llvm_coverage, ParallelReplicas, s3 storage, parallel) / 01666_merge_tree_max_query_limit trunk regression, not caused by this diff (312 hits over 256 unrelated pull requests and 33 master runs in 30 days) #112385 (mine, merged 2026-07-29 15:37Z); this build predates it, so a rerun after the next master merge picks it up

174 check-runs on this head, all completed: 1 failure, the row above. The two clickhouse-gh[bot] change requests that were open on the previous head are fixed here (SetsSerialization.cpp and ActionsVisitor.cpp now route through the shared set-storage helper), and the changelog category question is answered in a separate comment.

Session id: cron:our-pr-ci-monitor:20260729-193000

@clickhouse-gh clickhouse-gh Bot added pr-bugfix Pull request with bugfix, not backported by default and removed pr-not-for-changelog This PR should not be mentioned in the changelog labels Aug 1, 2026
@clickhouse-gh

clickhouse-gh Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

LLVM Coverage Report

Metric Baseline Current Δ
Lines 86.50% 86.50% +0.00%
Functions 91.90% 91.90% +0.00%
Branches 78.70% 78.70% +0.00%

Changed lines: Changed C/C++ lines covered: 38/41 (92.68%) · Uncovered code

Full report · Diff report

@groeneai

groeneai commented Aug 1, 2026

Copy link
Copy Markdown
Collaborator Author

CI finish ledger - 17e0616

Every failure below has an owner: a fixing PR (ours or external), or a full-effort fix task
whose fixing-PR link will be posted here when it opens. Only CH Inc sync is exempt.

Check / test Reason Owner / fixing PR
Stress test (amd_debug) / Query context must be created after authentication (STID 3197-391f) trunk bug: pre-auth query context on the PostgreSQL wire port, not reachable from this diff a fix task is moved to pending (investigating at full effort, fixing-PR link to follow here)
Stress test (arm_release) / Query context must be created after authentication (STID 3197-20e5) same trunk bug; the release build inlines the call site away, so the STID hash differs a fix task is moved to pending (investigating at full effort, fixing-PR link to follow here)
BuzzHouse (amd_debug) / No thread group attached to the thread 134 (STID 3358-2d6d) trunk bug in attachQueryForLog via ProcessList::insert, unrelated to this diff a fix task is moved to pending (investigating at full effort, fixing-PR link to follow here)

Session id: cron:our-pr-ci-monitor:20260801-230000

@groeneai

groeneai commented Aug 2, 2026

Copy link
Copy Markdown
Collaborator Author

Fixing PR for the pre-auth Query context must be created after authentication abort in the Stress test (*) failures ledgered above: #112940.

That PR reapplies #110760 (reverted in #112935) together with the fix: PostgreSQLHandler::cancelRequest no longer builds a query context from the unauthenticated session, cancelling through the new ProcessList::sendCancelToQueryOfAnyUser instead. Verified at its head bfc13929ce68df79, where the signature no longer appears in CIDB while the same Stress flavours ran.

@groeneai

groeneai commented Aug 2, 2026

Copy link
Copy Markdown
Collaborator Author

Fixing PR for the STID 3358-2d6d No thread group attached to the thread abort seen here in BuzzHouse (amd_debug): #113002 (external, open).

It stops BuzzHouse from randomly arming attach_to_group_failure, which is the trunk-side cause of that row. Still unrelated to this diff.

bobrik pushed a commit to bobrik/ClickHouse that referenced this pull request Aug 2, 2026
BuzzHouse enables a random failpoint from \`system.fail_points\`. Two of them -
\`attach_to_group_failure\` and \`thread_group_switcher_post_attach_failure\` - deliberately break the
invariant that a query thread is attached to a thread group. \`ThreadGroupSwitcher\` is \`noexcept\` and
only logs the injected failure, so the thread carries on with no group and the next \`executeQuery\`
that runs on it fails with the \`No thread group attached to the thread\` logical error, e.g.
https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=112766&sha=25a457c530e81c122d764503aa913d2d04eedbb1&name_0=PR&name_1=BuzzHouse%20%28amd_msan%29
(ClickHouse#112766). The same failure hit
ClickHouse#110514 in \`BuzzHouse (amd_debug)\` on the same day.

Both failpoints exist for the in-process unit test \`gtest_thread_group_switcher\`, which enables them
around a single controlled switch; they are not meaningful to inject from SQL. Exclude them from the
list the fuzzer picks from, like the other failpoints that legitimately take the server down.
@groeneai groeneai added the groeneai-origin-review-human PR origin: human review feedback on a groeneai PR label Aug 19, 2026
@clickhouse-gh

clickhouse-gh Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Dear @vdimir, you haven't been active on this PR for 30 days. You will be unassigned. Will you continue working on it? If so, please feel free to reassign yourself.

@clickhouse-gh clickhouse-gh Bot added the comp-simple-engines Lightweight single-node table engines: Log/StripeLog (append-only logs), Buffer (async batching),... label Sep 4, 2026

This branch has not been deployed

No deployments
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-simple-engines Lightweight single-node table engines: Log/StripeLog (append-only logs), Buffer (async batching),... groeneai-origin-review-human PR origin: human review feedback on a groeneai PR pr-bugfix Pull request with bugfix, not backported by default

Projects

None yet

Development

Successfully merging this pull request may close these issues.

flattenArrayTableExpressionOnRightOfIn wraps a Set-engine array table into an unreadable SELECT, throwing NOT_IMPLEMENTED on scalar IN set_table

3 participants