Skip to content

Keep the ProfileEvents-checked read of 05317_local_read_throttler_filesystem_cache off parallel replicas - #124920

Merged
fm4v merged 2 commits into
ClickHouse:masterfrom
groeneai:groeneai/05317-throttler-test-off-parallel-replicas
Oct 11, 2026
Merged

fm4v merged 2 commits into
ClickHouse:masterfrom
groeneai:groeneai/05317-throttler-test-off-parallel-replicas

Conversation

@groeneai

@groeneai groeneai commented Oct 9, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #124528
Related: #118495

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

05317_local_read_throttler_filesystem_cache (added in #118495) failed in Stateless tests (arm_binary, ParallelReplicas, s3 storage, parallel) on #124753 with 0 1 instead of 1 1 on its last line: report.

That lane runs every query with parallel replicas, and the coordinator hands marks to whichever replica asks first. When the remote replicas read all of them, the filesystem cache, file descriptor and throttler ProfileEvents land on their own query_log rows (current_database = 'default'), which the test's current_database = currentDatabase() filter drops. The initiator row then has CachedReadBufferReadFromCacheBytes = 0, and the throttler check compares 0 <= 0. The failing job's query_log artifact shows it: the initiator read 0 marks, the two remote rows 1 + 28 marks with 12268 + 1409476 cache bytes; in the 72 passing reruns the initiator read everything.

The change pins enable_parallel_replicas = 0 on the measured read only, as #124528 did for the columns cache tests, so both columns are evaluated on the row that did the read. The warm-up read keeps running under parallel replicas. No reference change.

Validation on a local ParallelReplicas rig, same binary: with parallel_replicas_local_plan = 0 the unmodified test fails 5/5 (only the last line) and the fixed one passes 10/10; with the slowdown_parallel_replicas_local_plan_read failpoint and the lane's default local plan, 14/20 vs 20/20. Removing the pin brings the failure back (5/5). The fixed test also passes 50/50 with randomized settings and parallel replicas off.


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

Version info

  • Merged into: 26.10.1.2121-master (included in 26.10 and later)

…lesystem_cache` off parallel replicas

In the `ParallelReplicas` CI configuration every query runs with parallel
replicas, and the coordinator hands the marks to whichever replica asks
first. When the remote replicas read all of them, the cache, file
descriptor and throttler `ProfileEvents` land on their own `query_log`
rows (`is_initial_query = 0`, `current_database = 'default'`), which the
test's `current_database = currentDatabase()` filter drops, so the
initiator row shows `CachedReadBufferReadFromCacheBytes = 0` and the
throttler check compares `0 <= 0`.

Observed in the failing job's `query_log` (PR ClickHouse#124753, arm_binary
ParallelReplicas): the initiator read 0 marks, the two remote rows read
1 + 28 marks with 12268 + 1409476 cache bytes.

Pin `enable_parallel_replicas = 0` on the measured read only, as ClickHouse#124528
did for the columns cache tests, so both columns are evaluated on the row
that did the read. The warm-up read is unchanged: the replicas are the
same server process and warm the same filesystem cache.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@groeneai groeneai added can be tested Allows running workflows for external contributors groeneai-origin-ci-own-pr PR origin: CI on a groeneai PR exposed a separate defect labels Oct 9, 2026
@groeneai

groeneai commented Oct 9, 2026

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

Pre-publication review by an independent model (engine: codex; 0 findings), plus my own cold review of the diff (0 findings).
Checked: the lane's enable_parallel_replicas comes from the default profile without constraints, so the query-level pin applies; remote ProfileEvents are only forwarded to the client (RemoteQueryExecutor.cpp), never merged into the initiator's query_log row; the sibling throttler tests 05111 and 02703 are no-object-storage and never run in the s3 ParallelReplicas lanes.

Session id: cron:clickhouse-review-slot-8:20261009-132700

@groeneai

groeneai commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator Author
Pre-PR validation gate (click to expand)
# Question Answer
a Deterministic repro? Yes. Local ParallelReplicas rig (3 replicas, local_cache disk) with parallel_replicas_local_plan=0: the unmodified test fails 5/5, only the last line 1 1 -> 0 1, as in CI.
b Root cause explained? Yes. When remote replicas read all marks, the ProfileEvents land on their query_log rows (current_database = 'default'), dropped by the test's filter; the failing job's query_log shows the initiator with 0 marks, the remote rows with 1 + 28.
c Fix matches root cause? Yes. enable_parallel_replicas = 0 on the measured read only makes the queried node do the read; no bound widened, no no-* tag, no reference change. Same per-query pin as #124528.
d Test intent preserved / new tests added? Yes, strengthened: both columns are now evaluated on the row that did the read (column 2 was vacuous whenever a remote replica read); fixed runs show 8.1M+ cache bytes and 0 throttled bytes on the initiator.
e Both directions demonstrated? Yes, same binary, only the test file differs: local plan off 5/5 FAIL -> 10/10 OK; slowdown_parallel_replicas_local_plan_read failpoint with the default local plan 14/20 FAIL -> 20/20 OK; pin removed again 5/5 FAIL.
f Fix is general across code paths? N/A (test-only). Siblings checked: 05111_local_read_throttler_page_cache and 02703_max_local_read_bandwidth are no-object-storage and never run in the s3 ParallelReplicas lanes.
g Fix generalizes across inputs (params/datatypes/wrappers)? N/A (test-only). The fixed test passed 60 randomized runs on the parallel replicas rig and 50 on a plain server.
h Backward compatible? (maintainer-approved exception only) N/A (test-only, no setting or format change).
i Invariants and contracts preserved? N/A (test-only). The other statements and the .reference are unchanged.

Session id: cron:clickhouse-impl-slot-41:20261009-130300

@clickhouse-gh

clickhouse-gh Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [ba8a360]

Summary: ✅


AI Review

Summary

This PR makes the ProfileEvents-checked read in 05317_local_read_throttler_filesystem_cache run with enable_parallel_replicas = 0, which matches the failure mode described in the PR: when a parallel-replica leaf performs the read, its ProfileEvents are written to a different query_log row than the initiator row that the test inspects. I reviewed the current diff, the full prior PR discussion, and the current green CI state, and I did not find a remaining correctness issue in this test-only change.

Final Verdict

✅ No new findings.

@groeneai

groeneai commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator Author

CI finish ledger - 30d2881

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 (arm_binary, s3 storage, DBReplicated, parallel, 1/2) / 05316_secret_arguments_declared_by_engines test regression from merged #123364, not from this PR (which changes only 05317_local_read_throttler_filesystem_cache.sql): under DatabaseReplicated the CREATE DICTIONARY row is counted twice in system.query_log. 111 PRs hit it in this lane since 2026-10-09 09:47Z #124928 (external, merged 17:58Z, after this run was built). It is the only red row, so I will merge master to pick it up
Mergeable Check, PR praktika rollups of the row above #124928 (external, merged)

The changed test 05317_local_read_throttler_filesystem_cache passed in every lane that ran it, including the ParallelReplicas lane where it used to fail, and in all five flaky checks.

Session id: cron:our-pr-ci-monitor:20261009-180009

@fm4v
fm4v added this pull request to the merge queue Oct 11, 2026
Merged via the queue into ClickHouse:master with commit ac85267 Oct 11, 2026
163 checks passed
@robot-clickhouse-ci-2 robot-clickhouse-ci-2 added the pr-synced-to-cloud The PR is synced to the cloud repo label Oct 11, 2026
@clickhouse-gh clickhouse-gh Bot added comp-filesystem-cache Filesystem cache for remote/object storage, page cache, and read caching infrastructure. 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-filesystem-cache Filesystem cache for remote/object storage, page cache, and read caching infrastructure. groeneai-origin-ci-own-pr PR origin: CI on a groeneai PR exposed a separate defect 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