Skip to content

[DO NOT MERGE] Enable parallel_replicas_plan_based by default to surface failing tests - #112351

Draft
devcrafter wants to merge 53 commits into
masterfrom
pr-plan-based-joins-default-on
Draft

devcrafter wants to merge 53 commits into
masterfrom
pr-plan-based-joins-default-on

Conversation

@devcrafter

@devcrafter devcrafter commented Jul 28, 2026 •

Copy link
Copy Markdown
Member

Description

Experiment / do not merge. Built on top of the pr-plan-based-joins work, this branch flips parallel_replicas_plan_based from false to true by default (and promotes its tier from EXPERIMENTAL to BETA) purely so CI runs the whole suite with plan-based parallel replicas enabled. The goal is to see how many tests break with the feature on.

Two bookkeeping-only changes keep unrelated checks green so the CI report reflects genuine feature behavior:

  • promoting the tier keeps 03413_experimental_settings_cannot_be_enabled_by_default passing (it filters only tier='Experimental');
  • a new SettingsChangesHistory entry under 26.11 keeps 03999_stateless_settings_history passing.

Changelog category (leave one):

  • Not for changelog (changelog entry is not required)

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

Not for changelog (experimental branch to surface failing tests; not intended for merge).


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

Flip the default of parallel_replicas_plan_based from false to true and
promote its tier from EXPERIMENTAL to BETA, so the test suite runs with
plan-based parallel replicas enabled and surfaces every test that breaks
with the feature on.

Promoting the tier keeps 03413_experimental_settings_cannot_be_enabled_by_default
passing (it filters only tier='Experimental'), and the new
SettingsChangesHistory entry under 26.8 keeps 03999_stateless_settings_history
passing, so remaining failures reflect genuine feature behavior rather than
bookkeeping.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@clickhouse-gh

clickhouse-gh Bot commented Jul 28, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [1970c53]

Summary: ❌

job_name test_name status info comment
Fast test FAIL
05045_opentelemetry_parallel_replicas_coordinator_spans FAIL cidb
05292_autopr_stats_key_constants FAIL cidb
05175_autopr_keep_cluster_engines FAIL cidb
Code Review DROPPED
Fast test (arm_darwin) DROPPED
Build (amd_debug) DROPPED
Build (amd_asan_ubsan) DROPPED
Build (amd_tsan) DROPPED
Build (amd_msan) DROPPED
Build (amd_binary) DROPPED
Build (arm_asan_ubsan) DROPPED
Build (arm_binary) DROPPED

@clickhouse-gh clickhouse-gh Bot added the pr-not-for-changelog This PR should not be mentioned in the changelog label Jul 28, 2026
devcrafter and others added 3 commits September 4, 2026 22:39
…-default-on

# Conflicts:
#	src/Core/Settings.cpp
Three problems, all on this branch:

- The record of `query_plan_read_in_order_through_spilling_join` outlived the setting itself, which
  master no longer declares. Every query that resolves `compatibility` walks the history and failed
  with `Unknown setting`, which is 59 failures across about 35 stateless tests. Remove the record.
- The record of `parallel_replicas_plan_based` sat in the `26.8` block, while the default is changed
  here and the current version is `26.9`. Move it and reword it accordingly - this is what the
  `settings_changes_history` style check asks for.
- `parallel_replicas_allow_merge_tables` is now enabled by default on this branch as well, so record
  it as a change of the default instead of a new setting keeping its value.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
devcrafter and others added 2 commits October 19, 2026 18:19
Master moved to 26.11, so the settings history check asks for a record under
the current version for every setting this branch changes. Both records were
written when the branch sat on 26.10 and neither flip ever shipped in 26.10,
so they move rather than gain a second `false` to `true` transition under a
new version.

`python3 -m ci.jobs.scripts.settings_history` now reports "the settings
history records every change made against origin/master under '26.11'".

https://github.com/ClickHouse/ClickHouse/actions/runs/39268386967/job/118115425025
#112351

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Each of these was pinned to the query-based implementation, and each now
passes with `parallel_replicas_plan_based` on: 10 runs apiece against a build
of the current branch, no failure, and the same with the setting off. A pin
that is not needed only hides whatever the test would otherwise catch.

- `04652_skip_indexes_in_read_pools`, whose mark counts were sensitive to how
  a parallel-replicas read is split.
- `04838_autopr_input_bytes_estimation_compact_codec`,
  `05098_autopr_gate_patch_parts`,
  `05099_autopr_gate_range_split_injection` and
  `05100_autopr_skip_index_on_data_read`, pinned for the automatic parallel
  replicas statistics gap (#118265).
  They pin `parallel_replicas_local_plan = 1`, so their statistics come from
  the initiator's own instrumented read and never depended on the plan shapes
  matching.

`05175_autopr_lazy_read_statistics` keeps its pin: unpinned it still reports
`0 0` where `1 1` is expected, once in ten runs. An intermittent failure is a
worse reason to unpin than a clean one.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
feiyunwill pushed a commit to feiyunwill/ClickHouse that referenced this pull request Oct 19, 2026
These tests describe the query-based implementation, and they passed only because
`parallel_replicas_plan_based` is off by default; pin the setting so that stays deliberate.

- `04724_parallel_replicas_right_join_materialized_left_*` assert that one `EXPLAIN` line carries
  both the reading step and the text `RIGHT JOIN`, i.e. the shipped SQL query, and 15 of their 33
  assertions look for `GLOBAL ALL RIGHT JOIN` together with `_data_` - that the left side was
  materialized into a temporary table. Plan-based ships a serialized plan fragment and has no
  temporary table, so those have no plan-based equivalent.
- `04651_pr_nway_join_non_leftmost_strictness` pins a restriction that exists because query-based
  ships the whole join tree to every replica. Plan-based places the split itself and distributes
  several of those shapes safely.
- `05098_autopr_gate_patch_parts` and `05099_autopr_gate_range_split_injection` assert that runtime
  dataflow statistics were collected, which does not happen with plan-based:
  ClickHouse#118265

The plan-based behaviour is asserted by two new tests instead of being lost:
`05212_pr_plan_based_nway_join_non_leftmost_strictness` checks that the shapes query-based refuses
are distributed and answer as they do without parallel replicas, and
`05213_pr_plan_based_right_join_materialized_left` records, per left-side shape, whether the read is
distributed and whether the join is inside the shipped fragment.

Related: ClickHouse#112351

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
feiyunwill pushed a commit to feiyunwill/ClickHouse that referenced this pull request Oct 19, 2026
Six tests in this family fail with `parallel_replicas_plan_based` on. Five of them assert
query-based mechanics and none of them showed a result difference - every differing line is a plan
step, an indentation change or a shipped query text:

- `02967_..._join_algo_and_analyzer_1`, `_2`, `_3` grep the query shipped to the replicas out of the
  trace log, and `03255_..._4` extracts it from the reading step's description. Plan-based ships a
  serialized plan fragment, so there is no query text to find.
- `02967_parallel_replicas_joins_and_analyzer` asserts the initiator's plan, where the right side of
  a join appears as `ReadFromMemoryStorage` - the temporary table it was materialized into. With
  plan-based the plan is shipped and the base table is read instead, so the whole plan differs.

The sixth is a real defect rather than a difference in shape:
`03254_parallel_replicas_join_with_totals` asserts only results, and with plan-based it loses the
`WITH TOTALS` block when `parallel_replicas_local_plan = 0`, which the harness picks at random - 5
failures out of 8 runs, against 0 out of 8 with the setting at 1 or with the query-based
implementation. Filed as ClickHouse#120000 and pinned to the
local plan only, so the test keeps covering both implementations for the configuration that works.

Related: ClickHouse#112351

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
`03394_pr_insert_select`, `03394_pr_insert_select_local_pipeline`,
`03394_pr_insert_select_threads`,
`04052_distributed_index_analysis_in_subquery_no_quadratic` and
`04341_autopr_mode1_apply_join` pass unpinned with the setting on, 10 runs
each.
devcrafter and others added 2 commits October 21, 2026 13:01
# Conflicts:
#	tests/queries/0_stateless/03560_parallel_replicas_memory_bound_merging_projection.reference
#	tests/queries/0_stateless/03560_parallel_replicas_memory_bound_merging_projection.sql
#	tests/queries/0_stateless/04277_parallel_replicas_join_dp_reorder.sql
#	tests/queries/0_stateless/04371_implicit_bool_filter_projection_parallel_replicas.sql
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…-default-on

# Conflicts:
#	tests/queries/0_stateless/03215_analyzer_replace_with_dummy_tables.sql
#	tests/queries/0_stateless/03403_parallel_blocks_marshalling_for_distributed.sql
#	tests/queries/0_stateless/03560_parallel_replicas_memory_bound_merging_projection.reference
#	tests/queries/0_stateless/03560_parallel_replicas_memory_bound_merging_projection.sql
#	tests/queries/0_stateless/03634_autopr_input_bytes_estimation_compact.sql
#	tests/queries/0_stateless/04277_parallel_replicas_join_dp_reorder.sql
#	tests/queries/0_stateless/04371_implicit_bool_filter_projection_parallel_replicas.sql
#	tests/queries/0_stateless/05043_autopr_set_source_leaf_steps.sql
#	tests/queries/0_stateless/05175_autopr_lazy_read_statistics.sql
…into pr-plan-based-joins-default-on

# Conflicts:
#	tests/queries/0_stateless/03403_parallel_blocks_marshalling_for_distributed.sql
#	tests/queries/0_stateless/03634_autopr_input_bytes_estimation_compact.sql
#	tests/queries/0_stateless/04371_implicit_bool_filter_projection_parallel_replicas.sql
#	tests/queries/0_stateless/05043_autopr_set_source_leaf_steps.sql
#	tests/queries/0_stateless/05175_autopr_lazy_read_statistics.sql

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp-parallel-replicas Parallel reading from replicas for query speed (not data replication consistency). pr-not-for-changelog This PR should not be mentioned in the changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants