Repository navigation
Enable the analyzer in the streaming-queries test client - #115957
Conversation
Streaming queries are only implemented in the analyzer: InterpreterSelectQuery
raises NOT_IMPLEMENTED ("Streaming queries are not supported with the old
analyzer") before the query runs. STREAMING_CLIENT did not enable it, so on jobs
built with the "old analyzer" option, which installs users.d/analyzer.xml and
disables the analyzer through the default profile, every STREAM query issued
through the lib exits immediately.
04235_streaming_queries_alter_projection_rejected failed deterministically on
master because of this. The SELECT ... STREAM it spawns died before registering
a subscription, so MergeTreeData::checkAlterIsPossible correctly found no
subscription, skipped the schema-changing-ALTER guard, and let MODIFY PROJECTION
through. Both halves of the diff, the missing SUPPORT_IS_DISABLED and
index_granularity becoming 128, come from that one cause. The guard is correct
and unchanged.
Pinning it in the lib rather than in the one test states a precondition of the
fixture, next to the enable_streaming_queries=1 that is there for the same
reason, and covers the nine sibling .sh tests that are latently affected but
currently skipped on that job by --no-long. Five .sql streaming siblings already
pin enable_analyzer = 1 in their bodies. A no-old-analyzer tag was rejected: it
would remove that job's only streaming.lib coverage.
Verified against a server carrying users.d/analyzer.xml: the test fails with the
exact CI diff before the change and passes after it, on the same build. With the
change applied and the guard deleted from MergeTreeData.cpp the test still
fails, so the assertion is not vacuous. 50 randomized and 50 non-randomized runs
pass, and the full 14-test streaming.lib family passes on a default server.
04545_streaming_queries_row_policy_multi_partition does not source streaming.lib. It builds its own client invocation, so the analyzer pin added to STREAMING_CLIENT does not reach it and its SELECT ... STREAM still hits NOT_IMPLEMENTED when the default profile disables the analyzer. The test runs with set -e against a one-line reference, so that exit aborts the script before it prints anything. It has not been failing only because its long tag keeps it out of the jobs that disable the analyzer. Verified against a server carrying users.d/analyzer.xml: the test fails without the flag and passes with it, ten runs in a row, and it still passes on a default server where the setting is already the default.
Internal second-model review (2 rounds, 0 open blockers)Two independent reviews of this diff (mine, cold, plus a second model), across two rounds.
On that last one:
Session id: cron:clickhouse-review-slot-11:20260822-230600 |
|
Workflow [PR], commit [7510f0f] Summary: ✅ AI ReviewSummaryThis PR makes Missing context / blind spots
Final Verdict✅ No review findings from the current diff. Merge looks reasonable once the pending CI finishes. |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-40:20260822-204300 |
|
cc @Michicosun, could you review this? Test-only: streaming queries need the analyzer, but |
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
Only the stripped binary is compared: the official master build keeps debug symbols while PR builds strip them, so the other binaries differ by construction. Compile time of recompiled translation units6 translation units recompiled, 4 s compile time in total, 6 of them have a recent master baseline. |
CI finish ledger - 51f5b75Every failure below has an owner: a fixing PR (mine or external), or a full-effort fix task
Detail on that row:
Session id: cron:our-pr-ci-monitor:20260823-050000 |
There was a problem hiding this comment.
Done in 7510f0f. It now sources streaming.lib and runs every statement through $STREAMING_CLIENT, with the table created from $STREAMING_TABLE_SETTINGS.
Two details worth flagging, since the two flag sets were not supersets of each other:
query_plan_remove_unused_columns,max_threads,max_threads_min_free_memory_per_threadandmax_execution_timewere only on this test's own client, so they moved into aSETTINGSclause on the streaming query rather than being dropped.$STREAMING_CLIENTaddsuse_skip_indexes_on_data_read=0, and$STREAMING_TABLE_SETTINGSadds the twoadd_minmax_index_for_block_*settings pluspart_minmax_index_columns, which this table did not set before. The row-policy assertion holds with them.
Verified on a server carrying users.d/analyzer.xml (allow_experimental_analyzer = 0 in the default profile, as the old-analyzer jobs install it): passes there and on a default-profile server, 10 of 10 runs, and 4 concurrent copies pass so it stays parallel-safe without a tag. All 26 streaming tests pass. Removing the pin from streaming.lib makes it fail with NOT_IMPLEMENTED again, so the test is genuinely relying on the shared pin rather than passing for another reason.
Description updated to describe the rewrite instead of the direct pin.
04545_streaming_queries_row_policy_multi_partition built its own client invocation instead of sourcing streaming.lib, so it did not inherit the streaming defaults the other ten shell streaming tests share and needed a separate analyzer pin of its own. It now sources the library and runs every statement through $STREAMING_CLIENT, with its three query-level settings moved into a SETTINGS clause on the streaming query and the table created with $STREAMING_TABLE_SETTINGS. Verified on a server carrying tests/config/users.d/analyzer.xml, which sets allow_experimental_analyzer = 0 in the default profile the way the old analyzer CI lanes do: the test passes there and on a default-profile server, 10 out of 10 runs on the old-analyzer profile, and 4 concurrent copies pass so no no-parallel tag is needed. Removing the pin from streaming.lib makes it fail with NOT_IMPLEMENTED again, so the pin is what the test depends on. All 26 streaming tests pass.
Head branch was pushed to by a user without write access
CI finish ledger - 7510f0fCI is fully finished at this commit and no check failed, so no ledger row is owed. Evidence: no check queued or in progress; Config Workflow, Style check and Finish Workflow all Session id: cron:our-pr-ci-monitor:20260823-183000 |
04545_streaming_queries_row_policy_multi_partition.sh moved onto streaming.lib in ClickHouse#115957 after this branch was cut, so the loop body conflicted. Took master's form, $STREAMING_CLIENT with the query settings in a SETTINGS clause, and dropped only max_execution_time from that clause. The rest of the file is master's verbatim, and the branch still changes exactly one file.
Enable the analyzer in the streaming-queries test client
Related: #113737
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Description
04235_streaming_queries_alter_projection_rejectedfails deterministically on master onStateless tests (amd_llvm_coverage, old analyzer, s3 storage, DBReplicated, WasmEdge, parallel, 2/3):9 master commits and 17 unrelated pull-request branches in three days, 3 of 3 reruns each. It has
never passed on that job; every other job is green. Report for the first occurrence:
https://s3.amazonaws.com/clickhouse-test-reports/json.html?REF=master&sha=9f73b426899380fb82c5acb883d0ad33a443e8cf&name_0=MasterCI&name_1=Stateless%20tests%20%28amd_llvm_coverage%2C%20old%20analyzer%2C%20s3%20storage%2C%20DBReplicated%2C%20WasmEdge%2C%20parallel%2C%202%2F3%29
Root cause:
streaming.lib'sSTREAMING_CLIENTdid not enable the analyzer, and streaming queriesare only implemented there (
InterpreterSelectQuery.cppraisesNOT_IMPLEMENTED). The job'sold analyzeroption installsusers.d/analyzer.xml, which turns the analyzer off through thedefault profile, so the
SELECT ... STREAMthe test spawns exits immediately (all 26 failing runslog
Streaming queries are not supported with the old analyzer. (NOT_IMPLEMENTED)), no subscriptionis registered, and the guard in
MergeTreeData::checkAlterIsPossibleis correctly skipped. Thatexplains both halves of the diff: the missing
SUPPORT_IS_DISABLEDandindex_granularitybecoming128. The guard is correct and unchanged.
The setting is a precondition of the fixture, like the
enable_streaming_queries=1already on thatline, so it is pinned in
streaming.lib; nine.sqlsiblings pinenable_analyzer = 1in theirbodies for the same reason.
04545_streaming_queries_row_policy_multi_partitionbuilt its own clientinvocation instead of sourcing the library, so it inherited none of those defaults. It now sources
streaming.liband uses$STREAMING_CLIENTand$STREAMING_TABLE_SETTINGSlike the other ten, withits query-level settings moved to a
SETTINGSclause, so all eleven shell streaming tests share onepin. A
no-old-analyzertag was rejected, it would remove the job's onlystreaming.libcoverage.Validated on a server carrying
users.d/analyzer.xml: both tests fail before the change and passafter, on the same build; with the guard also removed,
04235still fails, so the assertion is notvacuous.
04545passes there 10 of 10 and in 4 concurrent copies, all 26 streaming tests pass, andremoving the library pin makes it fail with
NOT_IMPLEMENTEDagain.Workflow [PR]
Sync PR [sync-upstream/pr/115957]
Version info
26.9.1.87(included in26.9and later)