Repository navigation
04545_streaming_queries_row_policy_multi_partition: no time limit - #113737
Conversation
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.
Internal second-model review (click to expand)Two independent reviews of the final tree: my own cold read of the resulting code, and an Final round: 0 findings from the independent pass; 1 nit from my own review, fixed below.
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: The removal also cannot let a random value back in: One apparent contradiction was worth resolving. I also closed the profile carriers rather than taking them on trust: the server default is 0, Session id: cron:clickhouse-review-slot-9:20260806-215600 |
Pre-PR validation gate (click to expand)
Validation: 50/50 randomized and 50/50 non-randomized runs pass ( Session id: cron:clickhouse-impl-slot-4:20260806-213900 |
|
cc @Michicosun, could you review this? It removes the per-query |
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.
|
Workflow [PR], commit [c4b364a] Summary: ✅ AI ReviewSummaryThis PR removes the query-level Final VerdictStatus: ✅ Approve |
|
Merged master. #115957 moved this test onto 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 After the merge, on today's master debug build ( CI had never run here: the previous head carried two check-runs, both skipped, because this PR was opened before the fleet began applying |
|
Correcting the last paragraph of my previous comment: I attributed the fresh run to the label, and the timestamps do not support that. The 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. |
CI finish ledger - 7600915Every failure below has an owner: a fixing PR (ours or external), or a full-effort fix task All seven reds below are one infra failure, not seven: each job was cancelled at queue time
Re-running does not recover this class, which is why it needs an owner rather than another retry: The hourly infra-retry workflow cannot see these: it lists runs with Session id: cron:our-pr-ci-monitor:20260826-203000 |
|
Fixing PR for the seven zero-step cancelled It fixes the scoring only. GitHub reports an undocumented It does not make the job run and deliberately does not unblock the merge: a dropped check still |
…-execution-time-04545-streaming-row-policy
|
@Michicosun can you look at this? The PR fix is small, and the test is still flaky in the CI |
efe9f7f
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]>
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Description
04545_streaming_queries_row_policy_multi_partition.shruns itsSTREAMquery 30 times with--max_execution_time=20. That limit cannot catch anything the test looks for: it asserts the querysucceeds (oracle
throwIf(max(b) >= 5000 OR count() = 0), noserverErrorexpectation) andSTREAM LIMIT 400over 10,010 rows bounds the read. So it can only turn a slow-but-correct run intoCode: 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
STREAMre-planning per partition per snapshot iteration: one query hereloaded 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 profilere-imposes it: the server default is 0,
limits.yamldoes not set it, and the 60slimits_fast.yamlreaches only Fast test, which skips
longtests.limits.yaml'smax_estimated_execution_time: 600needs 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 removedargv flag beat that, the cap there goes 20s to 60s.
Validation: 50/50 randomized and 50/50 plain runs pass, and the
streamingfamily is 21/21 on botharms. 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 isarmed.
Workflow [PR]
Sync PR [sync-upstream/pr/113737]
Version info
26.9.1.1515(included in26.9and later)