Skip to content

Fix flaky test 04949_distributed_plan_runtime_filter_receiver_no_lingering - #126252

Merged
davenger merged 1 commit into
ClickHouse:masterfrom
groeneai:fix-flaky-04949-runtime-filter-local-disk
Oct 16, 2026
Merged

davenger merged 1 commit into
ClickHouse:masterfrom
groeneai:fix-flaky-04949-runtime-filter-local-disk

Conversation

@groeneai

@groeneai groeneai commented Oct 16, 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):

Not required.

Description

Related: #114822

Stateless tests (arm_asan_ubsan, azure, parallel) on PR #126147 printed 1 1 0: a probe task (stage_0) took at least half as long as the build task (stage_1, which sleeps 10 s). The job later timed out, so the failure has no CIDB row and no server log.

On the azure lane the default MergeTree policy is a filesystem cache over Azurite. A read there can wait seconds for locks that only object-storage disks have, and a probe task's query_duration_ms starts before it scans big, so such a wait looks like a task that waited for the filter. In local mode probe tasks do not linger: RuntimeFilterReceiveBranches::finish cancels every receive branch within its 50 ms poll. Without a log the stall is inferred: the test failed only on the azure lane (1 of about 450 runs, 0 of about 8,500 elsewhere, 3,500 of them flaky-check runs), which also has its longest durations (up to 78 s, against 17 s for the same build on a local disk).

Both tables now use storage_policy = 'default'. The check, the sleep and the settings are unchanged; local-disk lanes see no difference.

Validation (master debug build):

  • Cache disk over a local disk as the default policy, cache writes paused for 15 s during the query: the old test prints 1 1 0 3/3 (probe tasks about 15.3 s, RuntimeFilterStatesReceived = 0), the new one 1 1 1 3/3 (probe tasks 52-226 ms).
  • With finish not cancelling the branches, the new test fails 3/3 (probe tasks about 10 s, each received the filter), so it still catches a lingering probe task.
  • 50/50 OK with randomized settings, on the local default and on the cache-default rig.

🤖 Generated with Claude Code


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

Version info

  • Merged into: 26.11.1.73-master (included in 26.11 and later)

The test checks that a probe task of a distributed plan does not wait for
the runtime filter: every probe (stage_0) task must take less than half
the time of the build (stage_1) task, which sleeps about 10 seconds.

On the azure lane the default MergeTree policy is a filesystem cache over
Azurite. A read there can wait seconds for locks that exist only on
object-storage disks (the cache lock held by consistency checks in
sanitizer builds, the metadata storage mutex during part commits). The
probe task's query_duration_ms counts from its process-list entry, which
is created before the scan of `big`, so such a wait makes a probe task
look like one that waited for the filter, and the check prints `1 1 0`.

Use storage_policy = 'default' for both tables. Storage is incidental to
what the test guards, and on local-disk lanes nothing changes.

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

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

Pre-publication review by an independent model (engine: codex; 1 finding) plus my own review. No blocker or major.

# Sev Finding Verdict Evidence / action
1 💡 The description should say the object-storage stall is inferred (the failing job left no server log) AGREE, fixed in the description Added the lane split: 1 of about 450 azure runs failed, 0 of about 8,500 elsewhere
2 💡 Related: #114822 in the description should be a full URL DISAGREE The full URL is in the template's relationship block; the short form is an extra visible link

Severity: ❌ blocker / ⚠️ major / 💡 nit. DISAGREE verdicts carry recorded evidence and are terminal per finding.

Session id: cron:clickhouse-review-slot-9:20261016-091100

@clickhouse-gh

clickhouse-gh Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [1cfcb6d]

Summary: ✅


AI Review

Summary

Pins both tables in 04949_distributed_plan_runtime_filter_receiver_no_lingering to storage_policy = 'default', excluding object-storage stalls from the probe-duration check. No actionable findings in the current diff.

Final Verdict

✅ Approve.

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Oct 16, 2026
@groeneai

Copy link
Copy Markdown
Collaborator Author

cc @davenger, could you review this? The probe-task duration check in 04949 failed once on the azure lane, where the tables sit on a filesystem cache over Azurite; pinning both tables to storage_policy = 'default' keeps object-storage stalls out of the timed scans.

@davenger davenger added the can be tested Allows running workflows for external contributors label Oct 16, 2026
@davenger davenger self-assigned this Oct 16, 2026
@clickhouse-gh clickhouse-gh Bot added the comp-testing Test content only (no production code). label Oct 16, 2026
@davenger
davenger enabled auto-merge October 16, 2026 11:51
@davenger
davenger added this pull request to the merge queue Oct 16, 2026
Merged via the queue into ClickHouse:master with commit 279de84 Oct 16, 2026
353 of 354 checks passed
@robot-ch-test-poll2 robot-ch-test-poll2 added the pr-synced-to-cloud The PR is synced to the cloud repo label Oct 16, 2026
JTCunning pushed a commit to JTCunning/ClickHouse that referenced this pull request Oct 21, 2026
On the azure lane the default MergeTree storage policy is a write-through
filesystem cache. The test's valid native-protocol INSERT writes a one-row
part, and every file of that part reserves cache space under the cache's
priority write lock. In Stateless tests (arm_asan_ubsan, azure, parallel) on
PR ClickHouse#126978 that INSERT spent 34.07 s of 34.43 s waiting on the lock
(FilesystemCachePriorityWriteLockMicroseconds), so the server's correct End of
stream arrived 4.4 s after the python client's hard-coded 30 s socket timeout
and the test failed with TimeoutError in readStrict.

The storage is incidental to a native-protocol LowCardinality test, so pin
the table to storage_policy = 'default' (the local disk on every lane). The
part write stays MergeTree, the 30 s hang guard and the .reference are
unchanged. Same shape as ClickHouse#122567 (04344) and ClickHouse#126252 (04949) for this lock.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@clickhouse-gh clickhouse-gh Bot added comp-distributed-query-exchange Distributed Query Execution with Exchange operators: cloud-native query distribution using stream... 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-distributed-query-exchange Distributed Query Execution with Exchange operators: cloud-native query distribution using stream... 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.

3 participants