Skip to content

Fix 01660_join_or_any - #75262

Merged
vdimir merged 6 commits into
masterfrom
vdimir/fix_old_any_join
Feb 5, 2025
Merged

vdimir merged 6 commits into
masterfrom
vdimir/fix_old_any_join

Conversation

@vdimir

@vdimir vdimir commented Jan 30, 2025

Copy link
Copy Markdown
Member

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 to CHANGELOG.md):

  • Fix unexpected defaults in join result with any_join_distinct_right_table_keys and OR in JOIN ON

Close #74641

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

Information about CI checks: https://clickhouse.com/docs/en/development/continuous-integration/

CI Settings (Only check the boxes if you know what you are doing)

All builds in Builds_1 and Builds_2 stages are always mandatory and will run independently of the checks below:

  • Only: Stateless tests
  • Only: Integration tests
  • Only: Performance tests

  • Skip: Style check
  • Skip: Fast test

  • Run all checks ignoring all possible failures (Resource-intensive. All test jobs execute in parallel).
  • Disable CI cache

@vdimir vdimir added the 🍃 green ci 🌿 Fixing flaky tests in CI label Jan 30, 2025
@robot-ch-test-poll robot-ch-test-poll added the pr-bugfix Pull request with bugfix, not backported by default label Jan 30, 2025
@robot-ch-test-poll2

robot-ch-test-poll2 commented Jan 30, 2025 •

Copy link
Copy Markdown
Contributor

This is an automated comment for commit b878331 with description of existing statuses. It's updated for the latest CI running

❌ Click here to open a full report in a separate page

Check nameDescriptionStatus
Stress testRuns stateless functional tests concurrently from several clients to detect concurrency-related errors❌ failure
Successful checks
Check nameDescriptionStatus
AST fuzzerRuns randomly generated queries to catch program errors. The build type is optionally given in parenthesis. If it fails, ask a maintainer for help✅ success
Bugfix validationChecks that either a new test (functional or integration) or there some changed tests that fail with the binary built on master branch✅ success
BuildsThere's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
BuzzHouse (asan)There's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
BuzzHouse (debug)There's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
BuzzHouse (msan)There's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
BuzzHouse (tsan)There's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
BuzzHouse (ubsan)There's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
ClickBenchRuns ClickBench with instant-attach table✅ success
Compatibility checkChecks that clickhouse binary runs on distributions with old libc versions. If it fails, ask a maintainer for help✅ success
Docker keeper imageThe check to build and optionally push the mentioned image to docker hub✅ success
Docker server imageThe check to build and optionally push the mentioned image to docker hub✅ success
Docs checkBuilds and tests the documentation✅ success
Fast testNormally this is the first check that is ran for a PR. It builds ClickHouse and runs most of stateless functional tests, omitting some. If it fails, further checks are not started until it is fixed. Look at the report to see which tests fail, then reproduce the failure locally as described here✅ success
Install packagesChecks that the built packages are installable in a clear environment✅ success
Integration testsThe integration tests report. In parenthesis the package type is given, and in square brackets are the optional part/total tests✅ success
Performance ComparisonMeasure changes in query performance. The performance test report is described in detail here. In square brackets are the optional part/total tests✅ success
Stateless testsRuns stateless functional tests for ClickHouse binaries built in various configurations -- release, debug, with sanitizers, etc✅ success
Style checkRuns a set of checks to keep the code style clean. If some of tests failed, see the related log from the report✅ success
Unit testsRuns the unit tests for different release types✅ success
Upgrade checkRuns stress tests on server version from last release and then tries to upgrade it to the version from the PR. It checks if the new server can successfully startup without any errors, crashes or sanitizer asserts✅ success

@novikd novikd self-assigned this Jan 30, 2025
@vdimir
vdimir enabled auto-merge February 5, 2025 18:44
@vdimir
vdimir added this pull request to the merge queue Feb 5, 2025
Merged via the queue into master with commit 53903d7 Feb 5, 2025
@vdimir
vdimir deleted the vdimir/fix_old_any_join branch February 5, 2025 23:36
@robot-ch-test-poll4 robot-ch-test-poll4 added the pr-synced-to-cloud The PR is synced to the cloud repo label Feb 5, 2025
nihalzp pushed a commit to nihalzp/ClickHouse that referenced this pull request Oct 9, 2026
…across parallel replicas

With `any_join_distinct_right_table_keys = 1`, `ANY RIGHT JOIN` becomes kind `Right` with
strictness `RightAny`: each left row takes the first right row of its key, and the whole key is
marked used. That choice is made over ALL right rows of the key.

The leftmost-leaf gate `allowParallelReplicasForJoinTree` admitted every `RIGHT` join, so the
whole join was shipped to the replicas, each replica read only its coordinated share of the right
table, and a left row that matched on several replicas was emitted once per replica
(`01660_join_or_any` returned `6 4` twice in the new ParallelReplicas job). The plan-based pass
had the same gap: `liftSplitAboveJoin` lifted the right-side split above such a join.

The query-tree walk `getSupportingParallelReplicasQueries` already refuses this shape (ClickHouse#75262).
Make the leftmost-leaf gate refuse it too, and in plan-based mode refuse only the lift, so the
right read stays distributed below the join and the join runs once over all right rows.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🍃 green ci 🌿 Fixing flaky tests in CI 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.

Test 01660_join_or_any is flaky

5 participants