Skip to content

04545_streaming_queries_row_policy_multi_partition: no time limit - #113737

Merged
Michicosun merged 3 commits into
ClickHouse:masterfrom
groeneai:groeneai/remove-max-execution-time-04545-streaming-row-policy
Sep 15, 2026
Merged

Michicosun merged 3 commits into
ClickHouse:masterfrom
groeneai:groeneai/remove-max-execution-time-04545-streaming-row-policy

Conversation

@groeneai

@groeneai groeneai commented Aug 6, 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):

...

Description

04545_streaming_queries_row_policy_multi_partition.sh runs its STREAM query 30 times with
--max_execution_time=20. That limit cannot catch anything the test looks for: it asserts the query
succeeds (oracle throwIf(max(b) >= 5000 OR count() = 0), no serverError expectation) and
STREAM LIMIT 400 over 10,010 rows bounds the read. So it can only turn a slow-but-correct run into
Code: 159 TIMEOUT_EXCEEDED, as it did once on an unrelated PR of mine (#113400).

04619_streaming_queries_shared_snapshot_strip_race.sql, the only other streaming test setting this,
keeps its max_execution_time = 2: there the limit is the oracle
({ serverError TIMEOUT_EXCEEDED }).

A slow iteration comes from STREAM re-planning per partition per snapshot iteration: one query here
loaded statistics 10 times to read ~1000 rows. I leave src/ alone; #106169 rewrites it.

The limit never bought headroom either: 30 x 20s is a 600s ceiling, exactly the harness's own
--timeout 600, whose 720s alarm still reports a genuine hang as "Timeout!". No installed profile
re-imposes it: the server default is 0, limits.yaml does not set it, and the 60s limits_fast.yaml
reaches only Fast test, which skips long tests. limits.yaml's max_estimated_execution_time: 600
needs one query over 300s (timeout_before_checking_execution_speed) against a measured 12ms
(system.query_log, n=30). Stress test caps it at 60s (stress_tests.lib:141); since the removed
argv flag beat that, the cap there goes 20s to 60s.

Validation: 50/50 randomized and 50/50 plain runs pass, and the streaming family is 21/21 on both
arms. Removing the cap does not measurably slow the test: two runs of the same 21-test suite on one
binary give 7.70s with the cap and 7.96s without, and the 20 unmodified tests move +0.50% between
them, so that +0.26s sits inside this test's own 7.46s to 9.47s spread. Reverting the #111572 source
fix makes it fail with Code: 10 Not found column less(b, 5000_UInt16) in block, so the oracle is
armed.


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

Version info

  • Merged into: 26.9.1.1515 (included in 26.9 and later)

The test loops its STREAM query 30 times with --max_execution_time=20. That
limit cannot catch anything the test looks for: the test asserts the query
SUCCEEDS (the oracle is throwIf(max(b) >= 5000 OR count() = 0), and the file
carries no serverError expectation), and the read is bounded by
STREAM LIMIT 400 over 10,010 pre-inserted rows, so it terminates on its own.
The limit can therefore only convert a slow-but-correct run into
Code: 159 TIMEOUT_EXCEEDED, which happened once on an unrelated PR (ClickHouse#113400).

What makes an iteration slow: a STREAM read re-runs full per-partition
planning on every snapshot iteration. Measured on this 10-partition table,
a single query logs 3 "Building new snapshot", 10 "Loading statistics",
10 "Moved conditions to PREWHERE" and 11 partition-key prunings while
reading about 1000 rows. That cost is left alone here, since
buildPartitionReadingPlan and buildNextSnapshotReadingPipeline are being
rewritten in ClickHouse#106169.

The sibling 04619_streaming_queries_shared_snapshot_strip_race.sql keeps its
max_execution_time = 2, because there the limit is the oracle
({ serverError TIMEOUT_EXCEEDED }). It is the only other streaming test that
sets the setting and is deliberately untouched.

The limit also never bought headroom: 30 iterations x 20s is a 600s ceiling,
exactly the harness's own --timeout 600. The installed test overlay does not
re-impose max_execution_time: the server default is 0, limits.yaml does not
set it, and the 60 second limits_fast.yaml is linked only under
FAST_TEST==1 && is_fast_build while Fast test passes --no-long and this test
is tagged long. Verified live on the installed stateless overlay:
system.settings reports max_execution_time 0, changed 0, while limits.yaml's
own values read changed 1. limits.yaml does set max_estimated_execution_time:
600, and that path is armed rather than inert, but the guard that reaches it
is a conjunction: the estimate is computed only once a query's own elapsed
time exceeds timeout_before_checking_execution_speed, which limits.yaml
raises to 300s, against a measured server-side 12ms per query
(system.query_log, n=30, min 10ms, max 72ms). It cannot substitute for the
removed cap.

One job adds a further cap on top of that overlay, and it is worth naming
because grep -rn max_execution_time tests/docker_scripts/ finds it. The Stress
test job runs the same install.sh, then configure_limits in
tests/docker_scripts/stress_tests.lib writes max_execution_time 60 into the
default profile, and stress_runner.sh calls that before starting the server
which runs the functional suite. The Stress test job passes neither --no-long
nor --no-parallel-replicas, and both skips are opt-in, so this test does run
there. That cap is looser than the one being removed, not tighter: a client
setting wins over the profile value, so the test's own --max_execution_time=20
was the effective limit there and it becomes 60s. Measured against that
profile: with no client flag system.settings reads 60, with the test's flag it
reads 20. Upgrade check never calls configure_limits, and the fuzzer and
performance profiles that also set the setting do not run clickhouse-test.

Runaway protection stays with the harness, which gives each file
--timeout 600 plus an int(600*1.1)+60 = 720s alarm and reports a hang as
"Timeout!". The flaky check's 180 second slow-test verdict
is gated on "long" not in tags and cannot fire here. This trades a fast false
failure for a slower true one.

Validation: the modified test passes 50/50 randomized and 50/50
non-randomized runs (--long-test-runs-ratio 1.0 is required, since the long
tag otherwise reduces 50 requested runs to 5). Removing the cap does not
measurably slow the test. Two runs of the same 21-test streaming suite on the
same binary give 7.70s with the cap (suite-base.log) and 7.96s without it
(suite-fix2.log). They are separate clickhouse-test invocations 131s apart,
so the comparison rests on a load control rather than on co-scheduling: the
20 unmodified tests in those same two runs move +0.50% in total (27.97s to
28.11s, per-test deltas -0.07s to +0.15s), and both logs carry identical
21-test name sets and the same server sha. The +0.26s difference is
therefore inside this test's own run-to-run spread of 7.46s to 9.47s across
the 50 randomized runs.
system.query_log confirms 30 oracle queries per run with zero timeouts, so
the pass is not a skipped loop. Reverting the ClickHouse#111572 source fix makes the
modified test fail with Code: 10 "Not found column less(b, 5000_UInt16) in
block" while executing MergeTreeCommitOrderSequentialSource, so the
regression oracle is still armed. The whole streaming family is 21/21 on
both arms.
@groeneai

groeneai commented Aug 6, 2026

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

Two independent reviews of the final tree: my own cold read of the resulting code, and an
independent second-model pass over five rounds. Every countable claim in the commit message and this
PR body was re-derived from source with a positive control, and every cited file:line resolved
against both this branch and current master.

Final round: 0 findings from the independent pass; 1 nit from my own review, fixed below.

# Finding Verdict
💡 The title named 04545_streaming_queries_row_policy — a truncation of ..._multi_partition, so the exact basename does not exist in the tree. Since ClickHouse merges with a merge commit whose subject is the PR title, that string becomes permanent history. Agreed, fixed. Retitled to name the test exactly. The natural prose form is 87 characters, so the colon form is what fits a title budget without cutting an identifier.
⚠️ An earlier round's commit message described the two suite runs as measured "side by side in one harness". They are separate clickhouse-test invocations 131 s apart. Agreed, fixed in an earlier round. The conclusion held (the 20 unmodified tests moved +0.50% between the runs, so the comparison rests on a load control), but the method wording was false and is now stated accurately.
⚠️ An earlier round published a p50 drawn only from the post-change randomized batch as evidence that runtime is "unchanged". Both batches were post-change, so they could not establish it. Agreed, fixed in an earlier round. Replaced by the same-binary A/B the retained logs actually support.
⚠️ An earlier body gave "0.27s per iteration". That was derived (whole-test wall clock ÷ 30), so it charged the fixture's two inserts of 10,010 rows to the loop. Agreed, fixed in an earlier round. Now the measured server-side 12 ms from system.query_log, which is what the guard's per-query stopwatch actually compares. The old figure was conservative, so no published conclusion changed.

What I checked that did not become a finding.

The load-bearing risk in removing a timeout is that the test stops testing anything. It does not:
reverting the #111572 source fix makes the modified test fail with
Code: 10 Not found column less(b, 5000_UInt16) in block ... While executing MergeTreeCommitOrderSequentialSource,
so the regression oracle is still armed. The throwIf oracle, the 30 iterations, the 10 partitions,
the row policy and set -e are byte-identical, and no no-random-* tag was added.

The removal also cannot let a random value back in: max_execution_time is not randomized by
clickhouse-test — zero occurrences, and an AST walk over every dict literal in that file finds no
such key, with max_threads and max_block_size as positive controls.

One apparent contradiction was worth resolving. 04619's comment says a streaming subquery "never
finishes", which reads against this PR's premise that STREAM LIMIT 400 terminates. The difference
is the ORDER BY: 04619 wraps its STREAM in ORDER BY key DESC ... LIMIT 10, which is blocking,
so its LIMIT is never satisfiable; this test has no ORDER BY, so LIMIT 400 is satisfied by the
first 400 rows. The retained runs contain 3000 completed STREAM queries with zero timeouts.

I also closed the profile carriers rather than taking them on trust: the server default is 0,
limits.yaml (linked unconditionally) sets none, limits_fast.yaml's 60 s reaches only Fast test
which passes --no-long, and the Stress job's configure_limits does apply here but takes the cap
from 20 s to 60 s — looser, not tighter. configure_limits has one call site repo-wide, so
Upgrade check is unaffected, and the fuzzer and performance profiles belong to jobs that run zero
clickhouse-test.

Session id: cron:clickhouse-review-slot-9:20260806-215600

@groeneai

groeneai commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator Author
Pre-PR validation gate (click to expand)
# Question Answer
a Deterministic repro? Yes. The recorded CI failure is a load-dependent spike (CI's own rerun passed 1/1), so the failure CHANNEL is reproduced instead: a slowed-but-correct form of the test's query (b + toUInt32(sleepEachRow(0.01)) AS b, oracle value unchanged since sleepEachRow returns 0) run with --max_execution_time=2 gives Code: 159 ... elapsed 2009.095 ms, maximum: 2000 ms 3/3, with CancellationChecker: Cancelling the task because of the timeout in the server log. Without the limit the same query returns the correct 0 3/3.
b Root cause explained? Yes. The test asserts the query SUCCEEDS (oracle is throwIf(max(b) >= 5000 OR count() = 0); 0 serverError expectations) and the read is bounded by STREAM LIMIT 400 over 10,010 rows, so it terminates on its own. A STREAM read re-runs full per-partition planning per snapshot iteration (measured on this 10-partition table, one query: 3 Building new snapshot, 10 Loading statistics, 10 Moved conditions to PREWHERE, 11 partition-key prunings, ~1000 rows read). Under co-scheduled load one iteration crosses 20s and the limit fails a run whose result is correct.
c Fix matches root cause? Yes. It deletes the limit, which is the sole mechanism by which the recorded failure occurred and which provably cannot catch anything this test looks for. Raising 20 to 60 was rejected as the widen-the-bound band-aid; no no-random-* tag was added; the workload was not reduced.
d Test intent preserved / new tests added? Yes, preserved byte-for-byte: the throwIf oracle, the 30 iterations, the 10 partitions, the row policy and set -e are unchanged. No new test is owed (this IS the test, and no coverage is removed). Verified by mutation, see (e).
e Both directions demonstrated? Yes, twice. (1) Limit present -> Code: 159 3/3, limit absent -> correct result 3/3. (2) Mutation M1, reverting the #111572 source fix (drop makeSelectQueryInfoForPartitionRead, pass query_info), makes the MODIFIED test FAIL: runner reports Having 1 errors! with Code: 10 NOT_FOUND_COLUMN_IN_BLOCK: Not found column less(b, 5000_UInt16) in block. There are only columns: _partition_id, _block_number, _block_offset: While executing MergeTreeCommitOrderSequentialSource (that is the row policy pruned off the shared DAG), plus a SIGSEGV in ActionsDAG::evaluatePartialResult and an abort in pruneFilterDAGOutputsByPosition, all through MergeTreeCommitOrderSequentialSource.cpp:227. Per-arm server restart with lower(buildId()) asserted against readelf -n on both arms (650a77cb... vs a74eca08...). Unmutated arm green.
f Fix is general across code paths? Yes. Every streaming test that sets max_execution_time was enumerated: exactly one other, 04619_streaming_queries_shared_snapshot_strip_race.sql, where the limit IS the oracle ({ serverError TIMEOUT_EXCEEDED }) and is correctly left untouched. The 8 setup/teardown client calls in this test (lines 10, 11, 13, 18, 19, 21, 32, 33) never had a limit; unlike 04619 (which needs SET max_execution_time = 0 before cleanup because it set a session-level value) this test set it per invocation, so there is no leak to clean up.
g Fix generalizes across inputs (params/datatypes/wrappers)? N/A for removing a setting from a test file. Input coverage comes from 50 randomized runs, which exercise the randomized settings that modulate the planning cost above (use_statistics, use_statistics_cache).
h Backward compatible? Yes, trivially: no settings, no formats, no SettingsChangesHistory entry, no backport (the test exists only on master, added 2026-08-04).
i Invariants and contracts preserved? Yes. The test's only failure modes remain its throwIf oracle and set -e on client failure. Runaway protection moves to the layer that owns it: clickhouse-test gives each file --timeout 600 plus a int(600*1.1)+60 = 720s alarm, reported as "Timeout!". The installed test overlay (tests/config/install.sh) does not re-impose max_execution_time: limits.yaml (linked unconditionally) does not set it, limits_fast.yaml (60s) is linked only under FAST_TEST==1 && is_fast_build while Fast test passes --no-long and this test is tagged long, and the server default is 0. One job does add a further cap on top of that overlay, and grep -rn max_execution_time tests/docker_scripts/ finds it: configure_limits in stress_tests.lib:141 writes max_execution_time 60 into the default profile, stress_runner.sh:238 calls it before starting the server that runs the functional suite, and the Stress test job passes neither --no-long nor --no-parallel-replicas (both skips are opt-in), so this test runs there. That cap is looser than the one being removed, not tighter: a client setting wins over the profile value, so the effective limit goes from 20s to 60s. Measured against that exact profile: with no client flag system.settings reads 60 changed=1, with the test's --max_execution_time=20 it reads 20, and a value above the accompanying <max>60</max> constraint is rejected with Code: 452. configure_limits has one call site repo-wide, so Upgrade check (which calls only configure) is unaffected, and the fuzzer (10s) and performance (300s) profiles that also set the setting run no clickhouse-test. Asserted live on the installed stateless overlay: system.settings reports max_execution_time 0 changed=0, while limits.yaml's own values (max_estimated_execution_time 600, timeout_before_checking_execution_speed 300, max_execution_speed 100G) all read changed=1, so the overlay is genuinely applied and the 0 is a real absence, not an unloaded profile. limits.yaml does set max_estimated_execution_time: 600, and that path is armed rather than inert: max_execution_speed: 100G satisfies the settings-presence half of the guard at ExecutionSpeedLimits.cpp:51-54 and timeout_overflow_mode defaults to THROW, so the TOO_SLOW throw at :82-102 is reachable in principle. But the same guard is a conjunction whose other half requires the query's own elapsed time to exceed timeout_before_checking_execution_speed, which limits.yaml raises to 300s, and the estimate is computed only inside it. Measured server-side per query: 12ms (system.query_log, n=30, min 10ms, max 72ms), i.e. four orders of magnitude short. It therefore cannot substitute for the removed cap. The flaky-check 180s slow-test verdict is gated on "long" not in tags and cannot fire here. Stated trade: a genuine future hang now takes up to 720s instead of 20s and is reported as a timeout rather than a query error.

Validation: 50/50 randomized and 50/50 non-randomized runs pass (--long-test-runs-ratio 1.0, since the long tag otherwise reduces 50 requested runs to 5; per-run verdict lines counted). Removing the cap does not measurably slow the test: two runs of the same 21-test streaming suite on the same binary give 7.70s with the cap (suite-base.log) and 7.96s without it (suite-fix2.log). Those are separate clickhouse-test invocations 131s apart, so the comparison rests on a load control rather than on co-scheduling: the 20 unmodified tests in those same two runs move +0.50% in total (27.97s to 28.11s, per-test deltas -0.07s to +0.15s), and both logs carry identical 21-test name sets and the same server sha. That +0.26s therefore sits inside this test's own run-to-run spread of 7.46s to 9.47s across the 50 randomized runs. system.query_log confirms 30 oracle queries executed per run with 0 timeouts, so the pass is not a skipped loop. The whole streaming family is 21/21 on both arms with 0 only-in-fix failures.

Session id: cron:clickhouse-impl-slot-4:20260806-213900

@groeneai

groeneai commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator Author

cc @Michicosun, could you review this? It removes the per-query --max_execution_time=20 from the 30-iteration loop in the streaming row-policy test you added: the test asserts the query succeeds and STREAM LIMIT 400 bounds the read, so the limit can only turn a slow-but-correct run into TIMEOUT_EXCEEDED, and I leave the per-partition planning cost to your #106169.

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.
@clickhouse-gh

clickhouse-gh Bot commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [c4b364a]

Summary: ✅


AI Review

Summary

This PR removes the query-level max_execution_time from 04545_streaming_queries_row_policy_multi_partition.sh after the test moved onto streaming.lib. The row-policy oracle (throwIf(max(b) >= 5000 OR count() = 0)) and the bounded STREAM LIMIT 400 read are unchanged, the current PR report is green, and I did not find a correctness, coverage, or contract regression in the current diff.

Final Verdict

Status: ✅ Approve

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Aug 26, 2026
@groeneai groeneai added the can be tested Allows running workflows for external contributors label Aug 26, 2026
@groeneai

Copy link
Copy Markdown
Collaborator Author

Merged master. #115957 moved this test onto streaming.lib after this branch was cut, so the loop body conflicted: I took master's form ($STREAMING_CLIENT, the query settings in a SETTINGS clause) and dropped only max_execution_time from that clause. The branch still changes one file, +3/-1.

Correcting the description, which says the limit cost one failure on an unrelated PR of mine: it has exceeded 20s six times in the last 30 days of public CI, every one of them Code: 159 TIMEOUT_EXCEEDED in the streaming commit-order source with the rerun passing. Two are on master, 21686 ms at 94a1553 and 24147 ms at 50ba465; the other four are on unrelated pull requests. Elapsed runs from 20063 ms to 24147 ms against the 20000 ms limit, so these are margin failures rather than hangs. The most recent, 2026-08-24, is on a master commit that already contains #106169, so the planning-cost rewrite the description defers to has not removed the failure.

Report for that run: https://s3.amazonaws.com/clickhouse-test-reports/json.html?REF=master&sha=94a1553123bb29dd8e3a3f85d7052322428a27bd&name_0=MasterCI&name_1=Stateless%20tests%20%28amd_tsan%2C%20parallel%29&name_1=Stateless%20tests%20%28amd_tsan%2C%20parallel%29

After the merge, on today's master debug build (82cfa6a, build id 148ccaca): 3 of 3 runs pass, and system.query_log shows 90 oracle queries (3 x 30) with zero exceptions and zero timeouts, so the loop is not being skipped.

CI had never run here: the previous head carried two check-runs, both skipped, because this PR was opened before the fleet began applying can be tested and so never received it. I have applied that label, so the matrix should run on this head.

@groeneai

Copy link
Copy Markdown
Collaborator Author

Correcting the last paragraph of my previous comment: I attributed the fresh run to the label, and the timestamps do not support that. The PR workflow run (attempt 2) was created at 14:10:46Z from the push, while the can be tested label was applied at 14:12:28Z, about a minute and a half later. So the new head from the master merge is what started CI here, not the label; the old head was stuck because a completed run is not re-dispatched at the same SHA.

I also should not have applied that label myself. It is a fork trust gate and applying it is a maintainer action, so please remove it if it is not wanted here; the run is already under way regardless.

@groeneai

Copy link
Copy Markdown
Collaborator Author

CI finish ledger - 7600915

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.

All seven reds below are one infra failure, not seven: each job was cancelled at queue time
and executed zero commands (conclusion: cancelled, runner_name: null, steps: []), so each
published zero rows to CIDB. None of them is PR-caused, because none of them ran a single step.

Check / test Reason Owner / fixing PR
Stateless tests (amd_tsan, sequential, selected tests) infra: cancelled at queue time, 0 steps, no runner a fix task is created (investigating at full effort, fixing PR link to follow on this PR)
Stateless tests (amd_tsan, s3 storage, sequential, selected tests) infra: cancelled at queue time, 0 steps, no runner same fix task
Stateless tests (amd_tsan, s3 storage, parallel, selected tests) infra: cancelled at queue time, 0 steps, no runner same fix task
Stateless tests (amd_debug, distributed plan, s3 storage, sequential) infra: cancelled at queue time, 0 steps, no runner same fix task
Stateless tests (amd_msan, WasmEdge, sequential, 1/2) infra: cancelled at queue time, 0 steps, no runner same fix task
Stateless tests (amd_msan, WasmEdge, parallel, 3/3) infra: cancelled at queue time, 0 steps, no runner same fix task
Stress test (arm_msan) infra: cancelled at queue time, 0 steps, no runner same fix task
Sync - CH Inc sync (private, not actionable by me; still pending at the time of writing)

Re-running does not recover this class, which is why it needs an owner rather than another retry:
run 32978669321 is already at attempt 3. Attempt 1 lost 1 job this way alongside a
Config Workflow failure, attempt 2 lost 8, attempt 3 still loses 7. Config Workflow and
Finish Workflow are both green at this head and no leaf was dropped (43 succeeded, 129 filtered
by the selected-tests gate), so this is a real run missing 7 jobs, not a lost matrix.

The hourly infra-retry workflow cannot see these: it lists runs with --status failure and
.attempt == 1, and its job classifier filters select(.conclusion == "failure"). A cancelled
job at attempt 3 fails all three conditions. A per-job re-run by someone with admin rights would
clear them; POST actions/jobs/<id>/rerun returns 403 Must have admin rights to Repository for
me.

Session id: cron:our-pr-ci-monitor:20260826-203000

@groeneai

Copy link
Copy Markdown
Collaborator Author

Fixing PR for the seven zero-step cancelled Stateless tests and Stress test lines in the CI finish ledger above: #116648.

It fixes the scoring only. GitHub reports an undocumented needs.<job>.result value,
abandoned, for a job it queued and never assigned a runner; praktika matched only
cancelled/canceled, so the job was scored ERROR with Job failed to produce Result due to a script error or CI runner issue even though it ran zero commands, and Mergeable Check then named
it under Failed:. With the fix the same run reads Failed: 0, Dropped: 1.

It does not make the job run and deliberately does not unblock the merge: a dropped check still
maps to a GitHub error status and still holds Mergeable Check at failure. The abandonment
itself is GitHub-side, and job retry lives in the out-of-repo Lambda.

@clickhouse-gh clickhouse-gh Bot added the comp-testing Test content only (no production code). label Sep 4, 2026
@PedroTadim PedroTadim self-assigned this Sep 14, 2026
@PedroTadim PedroTadim removed their assignment Sep 15, 2026
@PedroTadim

Copy link
Copy Markdown
Member

@Michicosun can you look at this? The PR fix is small, and the test is still flaky in the CI

@Michicosun
Michicosun disabled auto-merge September 15, 2026 08:20
@Michicosun
Michicosun added this pull request to the merge queue Sep 15, 2026
Merged via the queue into ClickHouse:master with commit efe9f7f Sep 15, 2026
348 of 349 checks passed
@robot-ch-test-poll4 robot-ch-test-poll4 added the pr-synced-to-cloud The PR is synced to the cloud repo label Sep 15, 2026
valerypetrov pushed a commit to valerypetrov/ClickHouse that referenced this pull request Oct 5, 2026
The test failed on `Stateless tests (arm_asan_ubsan, azure, parallel)` with
`Code: 159 ... Timeout exceeded: elapsed 21292.078 ms, maximum: 20000.000 ms`
on its first 8-row INSERT. On that lane MergeTree tables use a write-through
filesystem cache, and debug/sanitizer builds randomly run
FileCache::assertCacheCorrectness (check_cache_probability), which holds the
cache priority lock while it stats every entry. The INSERT spent 21.18 of its
21.29 s in FilesystemCachePriorityWriteLockMicroseconds (11 reservations)
behind a concurrent query that ran 23 such checks; the Azure uploads took 8 ms.

The session `max_execution_time = 20` is not part of any oracle: the test has no
serverError expectation, the reference holds only result values, and
STREAM BOUNDED terminates by itself, so a real hang still fails on the runner
timeout. Remove it, as ClickHouse#113737 did for
04545_streaming_queries_row_policy_multi_partition.

Validated with file_segment_pause_before_write holding the first INSERT's cache
write for 25 s on a write-through local_cache table: the old test fails with
Code 159 every time, the new one passes and matches the reference. 50/50
randomized runs, 20/20 with the write-through cache as the MergeTree default.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@clickhouse-gh clickhouse-gh Bot added comp-streaming-queries Streaming queries: queries that keep reading a table as data arrives - cursors, subscriptions to ... 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-streaming-queries Streaming queries: queries that keep reading a table as data arrives - cursors, subscriptions to ... groeneai-origin-oranjeai PR origin: delegated from the OranjeAI sibling fleet 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.

4 participants