Skip to content

Keep the cache-write check of 02963_remote_read_small_buffer_size_bug off parallel replicas - #125092

Merged
alexey-milovidov merged 1 commit into
ClickHouse:masterfrom
groeneai:fix-02963-cache-write-check-parallel-replicas
Oct 11, 2026
Merged

alexey-milovidov merged 1 commit into
ClickHouse:masterfrom
groeneai:fix-02963-cache-write-check-parallel-replicas

Conversation

@groeneai

@groeneai groeneai commented Oct 10, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #124911

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

02963_remote_read_small_buffer_size_bug failed twice in Stateless tests (arm_binary, ParallelReplicas, s3 storage, parallel) on unrelated PRs: #124879, #118380. Both printed write_block_size = 4338.

The test reads the filesystem-cache write shape of one SELECT from its own query_log row. In that lane the coordinator sometimes gives the read's only segment to a remote replica on the same server. The data writes then land on that replica's row (another query_id): in both failing jobs it holds 6 writes / 2465383 bytes, 410897 bytes per write, so the buffer sizing is fine. The initiator row only holds one 4338-byte write, which fails the check.

The change pins enable_parallel_replicas = 0 on the measured SELECT, next to the existing force_read_through_distributed_cache = 0 pin that is there for the same reason, as #124911 did for the string filter tests. No reference change.

Validation on a local ParallelReplicas rig with an S3 disk, same binary, with a failpoint that delays the local replica: unmodified 20/20 fail with the CI row (4338), fixed 20/20 and 50/50 pass with all writes on the initiator row and no secondary rows; removing only the pin fails 20/20 again. Without the failpoint, unmodified and fixed pass 30/30; fixed also passes 20/20 without parallel replicas.


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

Version info

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

… off parallel replicas

The test reads the filesystem-cache write shape of one SELECT from its own
system.query_log row. In the ParallelReplicas lanes the coordinator can give
the only segment of the read to a remote replica, whose query_log row has a
different query_id. The data writes then land on that row (6 writes,
2465383 bytes, 410897 bytes per write), and the initiator row only holds one
4338-byte write, so the check fails although the buffer sizing is fine.

Pin enable_parallel_replicas = 0 on the measured SELECT, next to the existing
force_read_through_distributed_cache = 0 pin that exists for the same reason.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@groeneai groeneai added can be tested Allows running workflows for external contributors groeneai-origin-ci-master PR origin: master/nightly CI monitoring finding labels Oct 10, 2026
@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; 0 findings) plus my own cold review (1 nit).

# Sev Finding Verdict Evidence / action
1 💡 The check passes vacuously when the measured row has no cache write (0/0 is NaN); pre-existing, unchanged here (02963_remote_read_small_buffer_size_bug.sh:49-53) DISAGREE With the pin the initiator does every cache write: 7 writes / 2469721 bytes in every fixed run, so the check measures real writes; no change

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

Session id: cron:clickhouse-review-slot-8:20261010-180300

@groeneai

Copy link
Copy Markdown
Collaborator Author
Pre-PR validation gate (click to expand)
# Question Answer
a Deterministic repro? Yes. Local ParallelReplicas rig with an S3 disk, failpoint slowdown_parallel_replicas_local_plan_read on: the unmodified test fails 20/20 with the CI row (write_block_size = 4338).
b Root cause explained? A remote replica on the same server takes the read's only segment (13 marks), so the data cache writes land on its own query_log row (another query_id). The initiator row keeps one 4338-byte write, and the test reads only that row.
c Fix matches root cause? Yes. enable_parallel_replicas = 0 on the measured SELECT makes this query do the read and the caching itself, like the existing force_read_through_distributed_cache = 0 pin. No bound or tag change.
d Test intent preserved / new tests added? Yes. Query, threshold and reference unchanged; the fixed row holds all 7 writes (2469721 bytes), so a buffer-sizing regression still fails it. Test-only change.
e Both directions demonstrated? Yes. With the failpoint: unmodified 20/20 fail, fixed 20/20 and 50/50 pass, pin line removed 20/20 fail. Without it: 30/30 pass in both arms; fixed 20/20 without parallel replicas.
f Fix is general across code paths? The measured SELECT is the test's only MergeTree read. The distributed cache is already pinned off, and the pin also disables automatic parallel replicas.
g Fix generalizes across inputs (params/datatypes/wrappers)? N/A (test setting pin). Checked at parallel_replicas_local_plan 1 and 0.
h Backward compatible? (maintainer-approved exception only) N/A (test-only).
i Invariants and contracts preserved? N/A for source. The check still reads one query's own row, now always the node that did the caching.

Session id: cron:clickhouse-impl-slot-5:20261010-171900

@clickhouse-gh

clickhouse-gh Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [2e5e359]

Summary: ✅


AI Review

Summary

This PR pins enable_parallel_replicas = 0 on the measurement query in tests/queries/0_stateless/02963_remote_read_small_buffer_size_bug.sh, which matches the failure mode described in the PR: the test reads ProfileEvents from its own query_log row, so if another replica performs the only read, the relevant cache-write counters move to a different row and the check becomes flaky. I did not find any new correctness, coverage, or PR-metadata issues in the current diff.

Final Verdict

✅ No findings. The change looks correct and merge-ready.

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Oct 10, 2026
@groeneai
groeneai requested a review from antonio2368 October 10, 2026 18:29
@clickhouse-gh clickhouse-gh Bot added the comp-testing Test content only (no production code). label Oct 10, 2026
@alexey-milovidov alexey-milovidov self-assigned this Oct 10, 2026
@alexey-milovidov
alexey-milovidov added this pull request to the merge queue Oct 10, 2026
Merged via the queue into ClickHouse:master with commit a4ff768 Oct 11, 2026
163 checks passed
@robot-clickhouse-ci-1 robot-clickhouse-ci-1 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-master PR origin: master/nightly CI monitoring finding 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