Skip to content

Disable 04316_reader_executor_basic with parallel replicas - #123709

Merged
alexey-milovidov merged 3 commits into
ClickHouse:masterfrom
groeneai:fix-04316-reader-executor-parallel-replicas-oracle
Oct 4, 2026
Merged

alexey-milovidov merged 3 commits into
ClickHouse:masterfrom
groeneai:fix-04316-reader-executor-parallel-replicas-oracle

Conversation

@groeneai

@groeneai groeneai commented Oct 3, 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

Failing job: Stateless tests (arm_binary, ParallelReplicas, s3 storage, parallel) on an unrelated PR. All data rows match; only the activation check prints 0 instead of 1. No related open issue found.

With parallel replicas the reads can all happen in the secondary queries sent to the other replicas. Those have their own query ids, so the activation check, which looks for using ReaderExecutor under the marked query's id, finds nothing. In the failing job's logs this was 2 of 133 executions of the probe.

The test is not meant to run with parallel replicas yet, so it is now tagged no-parallel-replicas, like its siblings 04508_reader_executor_encrypted and 04510_reader_executor_encrypted_layers. The ParallelReplicas job skips it, and other jobs run it with enable_parallel_replicas = 0.

Validation, with the parallel-replicas test profile and default_parallel_replicas cluster on one server:

  • --client-option parallel_replicas_local_plan=0 --no-random-settings: the test from master fails 5/5 (-1 +0); the tagged test passes 3/3, and its probe sends no secondary queries.
  • With the runner flags of the ParallelReplicas job (--no-parallel-replicas): skipped.
  • Randomized: 30/30 pass, and 20/20 with enable_parallel_replicas=0.

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

Version info

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

The activation check counted `using ReaderExecutor` text_log lines only
under the query id of the marked probe query. With parallel replicas the
probe's reads can all run in the secondary queries sent to the other
replicas (own query id, `initial_query_id` = the probe,
`current_database = 'default'`): the single 37-mark segment is
consistent-hashed to a remote replica, and if that replica announces
before the local replica's first request, the local replica gets nothing.
The executor still runs on the replicas, but the check printed 0.

Seen in `Stateless tests (arm_binary, ParallelReplicas, s3 storage,
parallel)`: 2 of 133 probe executions in the failing job; following
`initial_query_id` finds the line in all 133.

Accept a line from any query whose `initial_query_id` is the probe.
Without parallel replicas that is just the initiator, so other lanes are
unchanged.

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 3, 2026
@groeneai

groeneai commented Oct 3, 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; 2 findings) plus my own review (1 finding).

# Sev Finding Verdict Evidence / action
1 ⚠️ The new initial_query_id path is not forced; pin parallel_replicas_local_plan = 0 on the probe DISAGREE The check asserts the executor ran for the probe, and it prints 0 with use_reader_executor = 0 with and without parallel replicas. The new lookup was proven red to green with parallel_replicas_local_plan=0 (10/10 each). Pinning it would drop the default local-plan mode that tests/clickhouse-test keeps on purpose.
2 💡 Commit message lacks the CI report and PR links AGREE, not changed Amend is not allowed on the branch; the PR body links the failing job.
3 💡 04930_reader_executor_detached_segment reads ProfileEvents from the initiator row without no-parallel-replicas AGREE, not changed 0 failures in 5194 parallel-replicas runs in 14 days; out of scope.

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

Session id: cron:clickhouse-review-slot-9:20261003-145200

@groeneai

groeneai commented Oct 3, 2026

Copy link
Copy Markdown
Collaborator Author
Pre-PR validation gate (click to expand)
# Question Answer
a Deterministic repro? Yes. Server with the parallel-replicas test profile and the default_parallel_replicas cluster, then tests/clickhouse-test 04316_reader_executor_basic --test-runs 10 --no-random-settings --no-random-merge-tree-settings --client-option parallel_replicas_local_plan=0: 10/10 fail with -1 +0 on the last line.
b Root cause explained? Yes. Under parallel replicas the reads can all run in secondary queries (own query id, current_database = 'default', initial_query_id = the probe). The check only looked at the initiator's query id, so it printed 0 although the executor ran on the replicas.
c Fix matches root cause? Yes. The check now accepts lines from every query whose initial_query_id is the probe. No tag, no pinned setting, no widened bound.
d Test intent preserved / new tests added? Yes. With use_reader_executor = 0 the check still prints 0, with and without parallel replicas. It now also covers follower replicas. Test-only change.
e Both directions demonstrated? Yes. Deterministic: old 10/10 fail, new 10/10 pass. Randomized with prefer_localhost_replica=0 max_threads=1: old 29/50 fail, new 50/50 pass.
f Fix is general across code paths? Siblings 04508/04510 use the same check but are tagged no-parallel-replicas, so they never run in these lanes. Left as is.
g Fix generalizes across inputs (params/datatypes/wrappers)? N/A (test check fix). Verified with local plan on and off, and with parallel replicas off (50/50).
h Backward compatible? (maintainer-approved exception only) N/A (test-only).
i Invariants and contracts preserved? Without parallel replicas the query tree is only the initiator (initial_query_id = query_id), so behaviour there is the same as before.

Session id: cron:clickhouse-impl-slot-7:20261003-143400

@clickhouse-gh

clickhouse-gh Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [f912d03]

Summary: ✅


AI Review

Summary

This PR narrows 04316_reader_executor_basic to the environments it actually targets by adding no-parallel-replicas, which matches the maintainer-requested direction and the existing ReaderExecutor sibling tests that already opt out of parallel-replica lanes. In the current code, the change is scoped to test selection only, preserves the original activation check logic for supported lanes, and I do not see a remaining correctness or coverage issue in the diff.

Final Verdict
  • Status: ✅ Approve

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Oct 3, 2026
@groeneai
groeneai requested a review from CheSema October 3, 2026 16:15
@clickhouse-gh clickhouse-gh Bot added the comp-testing Test content only (no production code). label Oct 3, 2026
@groeneai

groeneai commented Oct 3, 2026

Copy link
Copy Markdown
Collaborator Author

CI finish ledger - 20d4452

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
Build (amd_fuzzers) / Build ClickHouse not from this PR: the same job is red on master and on 116 PRs in 24h; the clickhouse_fuzzer link outgrows the 2 GiB reach of the small code model #122521 (mine, open)
Mergeable Check, PR rollups, red only because of the row above #122521 (mine, open)
CH Inc sync - CH Inc sync (private, not actionable by me)

All 157 checks completed; CIDB has no other FAIL or ERROR on this head.

Session id: cron:our-pr-ci-monitor:20261003-200032

@CheSema

CheSema commented Oct 3, 2026 •

Copy link
Copy Markdown
Member

@groeneai mark test as no-parallel-replicas
I did not have an intend to run it on parallel replicas yet. I will test that later.

@CheSema CheSema self-assigned this Oct 3, 2026
The test is not meant to run with parallel replicas yet, as requested in
review: ClickHouse#123709 (comment)

This reverts the `initial_query_id` correlation of the activation check
back to the original query-id check and adds the `no-parallel-replicas`
tag instead, like the sibling tests `04508_reader_executor_encrypted` and
`04510_reader_executor_encrypted_layers`. The `ParallelReplicas` job now
skips the test, and other runs force `enable_parallel_replicas = 0` for it.

Failing job: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=121094&sha=6c83de06a5dc332c692119b8c88f487e1cb0e1f3&name_0=PR&name_1=Stateless%20tests%20%28arm_binary%2C%20ParallelReplicas%2C%20s3%20storage%2C%20parallel%29
PR: ClickHouse#121094

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@groeneai groeneai changed the title Fix flaky 04316_reader_executor_basic under parallel replicas Disable 04316_reader_executor_basic with parallel replicas Oct 3, 2026
@groeneai

groeneai commented Oct 3, 2026

Copy link
Copy Markdown
Collaborator Author

Done in 6632173: the test is tagged no-parallel-replicas, and I reverted the initial_query_id change, so the activation check is the same as on master. The description is updated.

@groeneai

groeneai commented Oct 4, 2026

Copy link
Copy Markdown
Collaborator Author

CI finish ledger - 6632173

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
Build (amd_fuzzers) / Build ClickHouse not from this PR: the clickhouse_fuzzer link fails with relocation R_X86_64_PC32 out of range; the same job is red on master and on 166 PRs in the last 24h #123738 (external, merged 2026-10-04 01:14Z). This workflow was dispatched at 23:08Z, before that merge, so the fix is not in the tree that ran; a master merge to pick it up follows
Mergeable Check, PR rollups, red only because of the rows above #123738

This PR changes only 04316_reader_executor_basic.sql, which passed everywhere it ran. All 157 checks completed and CH Inc sync passed; CIDB has no other FAIL or ERROR on this head.

Session id: cron:our-pr-ci-monitor:20261004-013156

…oracle

Picks up ClickHouse#123738, which fixes the Build (amd_fuzzers) link failure.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@alexey-milovidov
alexey-milovidov added this pull request to the merge queue Oct 4, 2026
Merged via the queue into ClickHouse:master with commit 7cbb8ad Oct 4, 2026
149 checks passed
@robot-clickhouse robot-clickhouse added the pr-synced-to-cloud The PR is synced to the cloud repo label Oct 4, 2026
@clickhouse-gh clickhouse-gh Bot added comp-io IO library: ReadBuffer / WriteBuffer and their implementations over files and memory, read and wr... 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-io IO library: ReadBuffer / WriteBuffer and their implementations over files and memory, read and wr... 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.

4 participants