Skip to content

Disable parallel replicas for RIGHT JOIN with distributed table on right side#90806

Merged
nickitat merged 6 commits intoClickHouse:masterfrom
zoomxi:duplicate_right_join
Dec 1, 2025
Merged

Disable parallel replicas for RIGHT JOIN with distributed table on right side#90806
nickitat merged 6 commits intoClickHouse:masterfrom
zoomxi:duplicate_right_join

Conversation

@zoomxi
Copy link
Copy Markdown
Contributor

@zoomxi zoomxi commented Nov 25, 2025

Changelog category (leave one):

  • Bug Fix (user-visible misbehavior in an official stable release)

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

Fix duplicate data issue in RIGHT JOIN with distributed table when parallel replicas enabled.

Details

When RIGHT JOIN with a distributed table on the right side, the distributed table would be wrapped into a subquery, causing parallel replicas to incorrectly choose the left table for parallel reading, and each replica would then independently read the distributed table, resulting in duplicate data.

@vdimir vdimir added the can be tested Allows running workflows for external contributors label Nov 25, 2025
@clickhouse-gh
Copy link
Copy Markdown
Contributor

clickhouse-gh bot commented Nov 25, 2025

Workflow [PR], commit [1c5cdf2]

Summary:

job_name test_name status info comment
Stateless tests (arm_asan, targeted) failure
00092_union_race_conditions_3 FAIL cidb
00092_union_race_conditions_3 FAIL cidb
00092_union_race_conditions_3 FAIL cidb
00092_union_race_conditions_3 FAIL cidb
00092_union_race_conditions_3 FAIL cidb
00092_union_race_conditions_3 FAIL cidb
01459_manual_write_to_replicas_quorum_detach_attach FAIL cidb, issue
01459_manual_write_to_replicas_quorum_detach_attach FAIL cidb, issue
01459_manual_write_to_replicas_quorum_detach_attach FAIL cidb, issue
01459_manual_write_to_replicas_quorum_detach_attach FAIL cidb, issue
Bugfix validation (functional tests) failure
03709_parallel_replicas_right_join_with_distributed FAIL cidb
Stateless tests (amd_msan, parallel) failure
02992_all_columns_should_have_comment FAIL cidb
Integration tests (amd_tsan, 1/6) failure
test_storage_nats/test_nats_jet_stream.py::test_nats_overloaded_insert FAIL cidb, issue
BuzzHouse (amd_debug) failure
Logical error: 'Inconsistent AST formatting: the query: FAIL cidb, issue

@clickhouse-gh clickhouse-gh bot added the pr-bugfix Pull request with bugfix, not backported by default label Nov 25, 2025
@nickitat nickitat self-assigned this Nov 25, 2025
@zoomxi zoomxi force-pushed the duplicate_right_join branch from fd89f22 to 3afee44 Compare November 26, 2025 01:24
@zoomxi
Copy link
Copy Markdown
Contributor Author

zoomxi commented Nov 26, 2025

Stateless tests (arm_asan, targeted)
Reason: Test runs too long (> 180s). Make it faster.

Stateless tests (amd_binary, ParallelReplicas, s3 storage, parallel)
#90857

Stateless tests (amd_msan, parallel)
03096_order_by_system_tables : Timeout exceeded

Stress test (arm_asan, s3)
Stress test (amd_ubsan)
Unexpected return type from concat. Expected Nullable(String). Got String.

Others are also unrelated to this pr.

@zoomxi zoomxi force-pushed the duplicate_right_join branch from 3afee44 to a4d5499 Compare November 26, 2025 07:39
@nickitat
Copy link
Copy Markdown
Member

The provided test fails to reproduce the issue. Pls find another one.

@zoomxi zoomxi force-pushed the duplicate_right_join branch 2 times, most recently from 8ee4031 to 98d31ba Compare November 28, 2025 04:09
@zoomxi zoomxi force-pushed the duplicate_right_join branch from 98d31ba to 9cfea42 Compare November 28, 2025 05:06
@zoomxi
Copy link
Copy Markdown
Contributor Author

zoomxi commented Nov 28, 2025

Cannot open file /tmp/clickhouse/tmpa2eee0ec-247a-485e-82ad-b6515eaee344.
CI seems to be having issues.

@nickitat
Copy link
Copy Markdown
Member

Cannot open file /tmp/clickhouse/tmpa2eee0ec-247a-485e-82ad-b6515eaee344. CI seems to be having issues.

unfortunately, yes. should be fixed by #91094

@nickitat nickitat added this pull request to the merge queue Dec 1, 2025
Merged via the queue into ClickHouse:master with commit 1839a50 Dec 1, 2025
124 of 130 checks passed
@robot-ch-test-poll robot-ch-test-poll added the pr-synced-to-cloud The PR is synced to the cloud repo label Dec 1, 2025
@zoomxi zoomxi deleted the duplicate_right_join branch December 2, 2025 01:41
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 pr-bugfix Pull request with bugfix, not backported by default 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