Skip to content

Fix the master build: pass the join analyze mode in the starved totals unit test - #115087

Merged
PedroTadim merged 1 commit into
ClickHouse:masterfrom
groeneai:groeneai/fix-master-build-starved-totals-analyze-mode
Aug 17, 2026
Merged

PedroTadim merged 1 commit into
ClickHouse:masterfrom
groeneai:groeneai/fix-master-build-starved-totals-analyze-mode

Conversation

@groeneai

@groeneai groeneai commented Aug 17, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #110892
Related: #113936

Changelog category (leave one):

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

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

...

Description

The master build is currently broken on every configuration that enables tests.
src/Processors/tests/gtest_merge_join_starved_totals.cpp:48 calls the three
argument TableJoin(const Settings &, VolumePtr, TemporaryDataOnDiskScopePtr)
constructor, but b1a380dc1c04 (#110892) inserted a JoinAnalyzeMode analyze_mode_
parameter in the second position, so the call no longer resolves:

error: no matching function for call to '__construct_at'
  note: in instantiation of 'std::make_shared<DB::TableJoin, DB::Settings &, std::nullptr_t, std::nullptr_t, 0>'
        requested here  src/Processors/tests/gtest_merge_join_starved_totals.cpp:48:28

This is base drift, not a bad merge. The test file was written on 2026-08-09,
#110892 merged on 2026-08-14, and #113936 merged on 2026-08-17. The merge queue
builds the pull request head, where the old signature was still current, while
MasterCI builds the post merge tree, so the break only appeared after the merge.
It fails unit_tests_dbms, which stops ninja clickhouse-bundle before the
binary exists, so Build (amd_debug), Build (amd_msan), Build (amd_tsan),
Build (amd_asan_ubsan), Build (arm_debug), Build (arm_msan),
Build (arm_tsan), Build (arm_asan_ubsan), Build (arm_tidy) and
Build (llvm_coverage_build) are all red, and every downstream check that needs
those binaries cannot run.

The fix passes JoinAnalyzeMode::None, which is exactly what the test used to
get: before the parameter existed, analyze_mode stayed at its in class default
of None. It also leaves the assertion intact. The only behavioural reader of
the mode on this path is MergeJoin::runPostBuildPhase, whose condition is
is_right || is_full || (is_all_join && collectExactMatches()), and the test
builds a JoinKind::Full join, so is_full already selects the branch.

Validation: the failing translation unit reproduces the CI error at master
6061d1c0df7e; with the change unit_tests_dbms and clickhouse both link and
MergeJoinStarvedTotals.FullJoinKeepsRightRows passes. To show the test is still
a live oracle and not merely compiling, hasPostBuildPhase was flipped to
false, which reproduced the original wrong results
({(0,0),(1,0),(2,0)} instead of {(0,0),(0,3),(1,1),(2,0)}).

Version info

  • Merged into: 26.8.1.1560 (included in 26.8 and later)

…s unit test

`gtest_merge_join_starved_totals.cpp` was written on 2026-08-09 against the
three argument `TableJoin(const Settings &, VolumePtr, TemporaryDataOnDiskScopePtr)`
constructor. Commit b1a380d (PR ClickHouse#110892, merged 2026-08-14) inserted a
`JoinAnalyzeMode analyze_mode_` parameter in the second position, so the call no
longer resolves.

The merge queue built the pull request head, which still had the old base, while
MasterCI builds the post merge tree, where the signature has already changed. The
test file therefore only broke after the merge, and it broke `unit_tests_dbms` in
every configuration that enables tests, which stops `ninja clickhouse-bundle`
before the binary is produced.

`JoinAnalyzeMode::None` is what the test used to get: before the parameter
existed, `analyze_mode` was left at its in class default of `None`. It also keeps
the assertion meaningful. The only behavioural reader of the mode on this path is
`MergeJoin::runPostBuildPhase`, whose condition is
`is_right || is_full || (is_all_join && collectExactMatches())`, and the test
builds a `JoinKind::Full` join, so `is_full` already selects the branch and the
mode cannot change the outcome.

Verified locally: the failing translation unit reproduces the CI error before the
change, `unit_tests_dbms` and `clickhouse` both link after it, and
`MergeJoinStarvedTotals.FullJoinKeepsRightRows` passes. To confirm the test is
still a live oracle rather than merely compiling, `hasPostBuildPhase` was flipped
to `false`, which reproduced the original wrong results
({(0,0),(1,0),(2,0)} instead of {(0,0),(0,3),(1,1),(2,0)}).
@groeneai

Copy link
Copy Markdown
Collaborator Author

Master is currently red on all test-enabled build configs (amd_debug, amd_msan,
amd_tsan, amd_asan_ubsan, arm_debug, arm_msan, arm_tsan, arm_asan_ubsan,
arm_tidy, llvm_coverage_build) because my #113936 added a gtest written against the
pre-#110892 3-arg TableJoin constructor. unit_tests_dbms fails to compile, so
ninja clickhouse-bundle never produces a binary and the downstream checks cannot run.

This is the one-line fix. JoinAnalyzeMode::None is what the test used to get from the
member default, and it cannot change the assertion: the only behavioural reader on this
path is MergeJoin::runPostBuildPhase, whose is_right || is_full || ... condition is
already satisfied by the test's JoinKind::Full.

I confirmed the test is still a live oracle rather than just compiling: flipping
hasPostBuildPhase() to false reproduces the original wrong results
({(0,0),(1,0),(2,0)} instead of {(0,0),(0,3),(1,1),(2,0)}).

@alexey-milovidov could you merge this when CI is green, since master build is blocked.

@clickhouse-gh

clickhouse-gh Bot commented Aug 17, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [00dce8b]


AI Review

Summary

This PR updates gtest_merge_join_starved_totals.cpp to pass the new JoinAnalyzeMode argument after TableJoin(const Settings &, ...) grew a parameter. I did not find a correctness or contract issue in the current diff: JoinAnalyzeMode::None matches the historical TableJoin default, and on this FULL ALL JOIN path MergeJoin::runPostBuildPhase still creates used_rows_bitmap because is_full is true, so the test's behavioral coverage is preserved rather than merely made to compile.

Final Verdict

✅ No new issues found in the current diff.

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Aug 17, 2026
@PedroTadim PedroTadim added the can be tested Allows running workflows for external contributors label Aug 17, 2026
@PedroTadim

Copy link
Copy Markdown
Member

cc @alexey-milovidov

@clickhouse-gh

clickhouse-gh Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Build profile diff (arm_release)

Comparing 00dce8b0b with master 9813c63e1 (stripped binary size, per-symbol sizes and ThinLTO time; compile times per translation unit against the most recent warmup build that recompiled it).

✅ No significant changes.

Binary sizes
Binary Master PR Δ
programs/clickhouse-stripped 695.13 MiB 692.11 MiB -3.01 MiB (-0.43%)

Only the stripped binary is compared: the official master build keeps debug symbols while PR builds strip them, so the other binaries differ by construction.

Compile time of recompiled translation units

6 translation units recompiled, 4 s compile time in total, 6 of them have a recent master baseline.

Job report

@PedroTadim
PedroTadim enabled auto-merge August 17, 2026 09:26
@PedroTadim
PedroTadim added this pull request to the merge queue Aug 17, 2026
Merged via the queue into ClickHouse:master with commit cb42582 Aug 17, 2026
266 of 356 checks passed
@robot-clickhouse-ci-1 robot-clickhouse-ci-1 added the pr-synced-to-cloud The PR is synced to the cloud repo label Aug 17, 2026
groeneai added a commit to groeneai/ClickHouse that referenced this pull request Aug 17, 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 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