Repository navigation
Make 03354_pr_disable_for_multiple_tables_query work with plan-based parallel replicas - #128142
Conversation
…ions Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
|
Workflow [PR], commit [e8ae2b3] Summary: ✅ AI ReviewSummaryThis test-only PR makes Final VerdictStatus: ✅ Approve |
groeneai
left a comment
There was a problem hiding this comment.
Reviewed 6ce66f3 with the master debug binary at its merge base (474f3e32, the PR changes only the test), on a local server with test_cluster_one_shard_three_replicas_localhost pointed at it.
- The test passes at
parallel_replicas_plan_based= 0 and = 1: 9 of 10 randomized runs OK at each value, the other run failed before the first query on asession_timezonedraw my local box rejects (Code: 36). - With the setting on, query-based has 1 to 3
ReadFromRemoteParallelReplicasper probe (2 for theORDER BYsubquery joins and theX/Zunion, 3 for the nested union), and plan-based has exactly oneReadFromParallelReplicasin every probe. With the setting off, both have none. So presence is the one check that fits a single reference for both. - The probes can still fail. With
disableParallelReplicasForSubqueriesmade a no-op, the test goes red under both implementations: 7 off arms flip to 1 with query-based, 6 with plan-based. The one that stays 0 with plan-based isX as s inner join (select * from Y) as j, as expected: plan-based checks the context of the coordinated read, andYis the broadcast side.
Outside this PR: the plan-based fragment takes its context from the last coordinated read (applyParallelReplicas.cpp#L684-L692), so enable_parallel_replicas = 0 on an earlier union branch is not honored. select * from ((select id from X settings enable_parallel_replicas = 0) union all (select id from Z)) ships both reads in one ReadFromParallelReplicas, while query-based reads X locally. The switch tested here is not affected, since it disables every branch.
The merge queue fast-forwards master over up to 5 merges in one push and
MasterCI runs once, for the push head. For a push, praktika read the changed
files of the head commit only (`gh api commits/{sha}`), so a job affected
only by an earlier commit of the same push was filtered as "Not affected by
the changed files and not required", and functional/integration shards
skipped themselves as "Only test files changed". At master c189bd9 (ClickHouse#128277
in `src/` + ClickHouse#128142 tests only) this skipped 95 jobs, including both
`Build (*_release_performance_reference)`, so PR performance runs based on it
fell back to the official build (`long_primary_key` +16% on amd, ClickHouse#127846).
At f760cbb all 32 builds were skipped.
Now a push event records its `before` (`_Environment.PUSH_BEFORE_SHA`), and
`GH.get_changed_file_statuses` walks first parents from the head down to it,
reading all pages of each commit's file list (`gh api --paginate`), and
unions them (the newest commit's status wins). If the files cannot all be
known - an all-zero or malformed `before` (created branch), a failed or
malformed read, a commit at GitHub's 3000-file listing limit, a walk that
does not reach `before` within 50 commits - the result is `None` with a
warning, never a partial list, and it is not cached. `store_data.py` keeps
`None` for push events, so no job is filtered by it (`Job.is_affected_by`);
before, a failed read stored `[]`, which filtered every non-required job.
Without `before` (local runs, the native orchestrator) the head-only read
is unchanged; PR, merge queue, schedule and dispatch are unchanged.
Validated locally against the real GitHub API by replaying the 404 batched
master pushes of October: the result equals the union of every pushed
commit's files (re-parsed independently, commit lists from git) on 402, and
is unknown on the 2 that contain a 3000-file commit (ClickHouse#126194, and the docs
translation ClickHouse#124860); the job filter keeps 14,871 more job-runs on 131
pushes, plus 952 test shards that self-skipped now run in full, ~+7.8% of
October's 203,420 master job-runs, including both reference builds on 106
pushes. 100 single-commit pushes give identical statuses, with one request
for heads of up to 100 files.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
03354_pr_disable_for_multiple_tables_querychecks thatparallel_replicas_for_queries_with_multiple_tablesreaches every place that plans a part of a multi-table query, by looking forReadFromRemoteParallelReplicasinEXPLAIN. Withparallel_replicas_plan_basedthe read from the other replicas isReadFromParallelReplicas, so every probe printed0and the test failed with plan-based parallel replicas on by default (#112351).2against1for the joins with anORDER BYsubquery).UNIONprobes read distinct tables (ZandW, copies ofX): plan-based parallel replicas leave local a union whose branches read the same table, soX union all Xshowed no read from the other replicas even with the setting on, and the probe could not tell whether the setting was obeyed.With the setting off, every probe prints
0under both implementations. The test passes locally withparallel_replicas_plan_basedon and off.Related: #112351
Changelog category (leave one):
🤖 Generated with Claude Code
Workflow [PR]
Sync PR [sync-upstream/pr/128142]
Version info
26.11.1.999-master(included in26.11and later)