Skip to content

Insert into the Join tables of 05494_join_hashed_keys without parallel replicas - #130995

Merged
harikrishnan94 merged 1 commit into
ClickHouse:masterfrom
harikrishnan94:05494-join-inserts-without-parallel-replicas
Nov 12, 2026
Merged

harikrishnan94 merged 1 commit into
ClickHouse:masterfrom
harikrishnan94:05494-join-inserts-without-parallel-replicas

Conversation

@harikrishnan94

@harikrishnan94 harikrishnan94 commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

With parallel replicas, an INSERT ... SELECT into a Join table runs on every replica, and the inserts share the initial query id. StorageJoin takes its write lock by that id, so when two replicas insert at the same time, the second one fails with DEADLOCK_AVOIDED. The test now inserts into its Join tables without parallel replicas, as it already reads them.

https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=129209&sha=013785db07d54a273f8795ffd2b6a00f4cb1345f&name_0=PR&name_1=Stateless%20tests%20%28arm_binary%2C%20ParallelReplicas%2C%20s3%20storage%2C%20parallel%29

Related: #129328

Changelog category (leave one):

  • CI Fix or Improvement (changelog entry is not required)

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

Version info

  • Merged into: 26.11.1.2073-master (included in 26.11 and later)

…allel replicas

With parallel replicas, an `INSERT ... SELECT` into a `Join` table runs on every replica, and the inserts share the
initial query id. `StorageJoin` takes its write lock by that id, so when two replicas insert at the same time, the second
one fails with `DEADLOCK_AVOIDED`.

https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=129209&sha=013785db07d54a273f8795ffd2b6a00f4cb1345f&name_0=PR&name_1=Stateless%20tests%20%28arm_binary%2C%20ParallelReplicas%2C%20s3%20storage%2C%20parallel%29
Related: ClickHouse#129209
Related: ClickHouse#129328

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copilot AI balanced review requested due to automatic review settings November 12, 2026 06:46
@clickhouse-gh

clickhouse-gh Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [c29c30a]

Summary: ✅


AI Review

Summary

PR #130995, reviewed at c29c30a6a0ac01eee7d738211e420a76144e679d, disables parallel replicas for the two Join table inserts in 05494_join_hashed_keys, avoiding concurrent inserts with the same initial query ID and the resulting DEADLOCK_AVOIDED exception. The query settings take effect before distributed insert planning, and the existing hashed-key and persistence assertions remain intact. No actionable findings. Validation used source tracing and the linked CI failure; the test was not run locally, and the available PR CI reports do not confirm its runtime result.

Final Verdict

Status: ✅ Approve. No changes requested.

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Nov 12, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are reported for the test change disabling parallel replicas on the two Join table inserts.

No open issues 🎉

What changed in this PR

This PR stabilizes the hashed-key join test by disabling parallel replicas for inserts into Join tables, avoiding concurrent writes with the same initial query ID that can trigger DEADLOCK_AVOIDED.

Changes:

  • Adds enable_parallel_replicas = 0 to both Join table inserts, matching the existing read behavior.
  • Adds a comment explaining why these inserts must run without parallel replicas.
File Description
tests/​queries/​0_stateless/​05494_join_hashed_keys.sh Disables parallel replicas for two Join table inserts and documents the reason.

Review effort: Balanced

@harikrishnan94 harikrishnan94 added the can be tested Allows running workflows for external contributors label Nov 12, 2026
@clickhouse-gh clickhouse-gh Bot added the comp-testing Test content only (no production code). label Nov 12, 2026
@harikrishnan94
harikrishnan94 added this pull request to the merge queue Nov 12, 2026
Merged via the queue into ClickHouse:master with commit bf19dfe Nov 12, 2026
401 of 402 checks passed
@harikrishnan94
harikrishnan94 deleted the 05494-join-inserts-without-parallel-replicas branch November 12, 2026 10:26
@robot-clickhouse robot-clickhouse added the pr-synced-to-cloud The PR is synced to the cloud repo label Nov 12, 2026
@clickhouse-gh clickhouse-gh Bot added comp-joins JOINs end-to-end (planning hooks + runtime join operators/algorithms). Single bucket to avoid pla... 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-joins JOINs end-to-end (planning hooks + runtime join operators/algorithms). Single bucket to avoid pla... 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