Skip to content

Backport #106928 to 25.8: Fix Invalid number of rows in Chunk in JoiningTransform with additional join filter - #113160

Merged
alexey-milovidov merged 3 commits into
25.8from
backport/25.8/106928
Aug 4, 2026
Merged

alexey-milovidov merged 3 commits into
25.8from
backport/25.8/106928

Conversation

@robot-clickhouse-ci-1

@robot-clickhouse-ci-1 robot-clickhouse-ci-1 commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

Original pull-request #106928

This pull-request is a last step of an automated backporting.
Treat it as a standard pull-request: look at the checks and resolve conflicts.
Merge it only if you intend to backport changes to the target branch, otherwise just close it.

The PR source

The PR is created in the CI job

Version info

  • Merged into: 25.8.29.51

…ingTransform with additional join filter
@robot-clickhouse-ci-1 robot-clickhouse-ci-1 added pr-backport Changes, backported to release branch. Do not use manually - automated use only! pr-bugfix Pull request with bugfix, not backported by default labels Aug 3, 2026
@clickhouse-gh

clickhouse-gh Bot commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [BackportPR], commit [e79e043]

alexey-milovidov and others added 2 commits August 4, 2026 08:16
`LIMIT BY ALL` is not supported by the analyzer in 25.8 (it was added
later on master), so the backported test failed with
`Unknown expression identifier ALL` (`UNKNOWN_IDENTIFIER`). Replaced it
with the equivalent explicit list of the SELECT expressions; both forms
return 8817 on master.

CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=113160&sha=latest&name_0=BackportPR&name_1=Stateless%20tests%20(amd_asan%2C%20distributed%20plan%2C%20parallel%2C%202%2F2)
PR: #113160

Co-Authored-By: Claude Fable 5 <[email protected]>
@alexey-milovidov

Copy link
Copy Markdown
Member

🕵 @groeneai, investigate the failure: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=113160&sha=latest&name_0=BackportPR&name_1=Integration%20tests%20(amd_tsan%2C%205%2F6) (test_jbod_balancer/test.py::test_jbod_balanced_merge, plus a job error in the same run) and provide a fix in a separate PR. If the fix is already in progress, link it here. It is unrelated to this backport, which only touches HashJoinMethodsImpl.h and a stateless test.

The other red check (04330_join_global_left_semi_chunk_consistency) was caused by LIMIT 39 BY ALL not being supported by the analyzer in 25.8; it is fixed by replacing it with the equivalent explicit expression list.

@groeneai

groeneai commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Investigated. Both are 25.8-only and neither is related to this backport. Details below; the test failure already has a fix on master that needs a label, and the job error is a real one-character CI bug I will send a PR for.

1. test_jbod_balancer::test_jbod_balanced_merge

The 25.8 failure is not the balance assertion, it is the merge-wait giving up:

Exception: There are still merges on-going after 19 assignments
test_jbod_balancer/test.py:94

wait_until_fully_merged polls range(20) times, and the test is deliberately merge-heavy (600 inserts across three tables, max_bytes_to_merge_at_max_space_in_pool = 4096), so under TSAN 20 assignment rounds is simply not enough. This was already fixed on master by amosbird in #88104 (range(20) -> range(200), merged 2025-10-05). 25.8 branched before it, so it still has range(20) at line 81 and keeps failing.

I confirmed the cherry-pick is clean and touches nothing else:

tests/integration/test_jbod_balancer/test.py | 2 +-

Since I do not hand-author release-branch PRs, could you apply v25.8-must-backport to #88104? The robot will then produce the 25.8 backport.

For completeness, on master the test does fail occasionally, but with a different signature (assert set() == {'0', '1'} in check_balance) and in the last 45 days only on one PR (#111663, 6 hits, 0 on master itself). That is a separate, insert-side issue and not what failed here.

2. The job error

ERROR:root:Can't split tests by execution time: 404 Client Error: Not Found for url:
https://play.clickhouse.com//?user=play&password=&query=...

Note the double slash. ci/jobs/scripts/integration_tests_runner.py:30 already ends the base URL with a slash:

CLICKHOUSE_PLAY_URL = f"https://{CLICKHOUSE_PLAY_HOST}/"

and line 822 appends another one:

f"{CLICKHOUSE_PLAY_URL}/?user={CLICKHOUSE_PLAY_USER}"

// is not a valid handle, so the server answers There is no handle //?.... A/B against play with the job's own query:

  • https://play.clickhouse.com//?... -> HTTP 404, There is no handle //?...
  • https://play.clickhouse.com/?... -> HTTP 200 with the expected JSON

So this is deterministic, not a play outage, and the three retries can never succeed. The consequence is silent rather than fatal: the runner falls back to grouping by test count instead of duration (integration_tests_runner.py:1030-1035), so the batches stay unbalanced on every integration run on 25.8. That is plausibly why this shard took 1:02:24.

This affects 25.8 only. ci/jobs/scripts/integration_tests_runner.py no longer exists on master, 26.7, 26.6, 26.5 or 26.3 (master replaced it with the static duration table in integration_tests_configs.py), so there is nothing to fix forward and no backport route. I will open a separate PR against 25.8 dropping the redundant slash.

There is one more line in the job log, but it is benign and I do not think it is worth fixing:

  • PreconditionFailed on the very first versioned result_backportpr.json upload. That is the praktika optimistic-concurrency retry doing its job; attempt 2 succeeded one second later.
  • OSError: [Errno 9] Bad file descriptor in Pool.__del__, printed as Exception ignored in. The test creates Pool(20) without a context manager or close, so the pool is finalized during interpreter teardown. It does not affect the result.

@groeneai

groeneai commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

The play URL fix is #113317.

One character: CLICKHOUSE_PLAY_URL already ends with a slash, so the extra one at
integration_tests_runner.py:822 made every request go to https://play.clickhouse.com//?...,
which the server answers with There is no handle //?... and 404.

I verified it by driving the real get_tests_execution_time, once from the unmodified 25.8
file and once from the fixed one: the pre-fix method exhausts all three retries with 404, the
fixed method returns durations for 1061 test modules.

It targets 25.8 directly because ci/jobs/scripts/integration_tests_runner.py exists only
there. It is absent from master, 26.7, 26.6, 26.5 and 26.3, where the duration query
was replaced by the static table in integration_tests_configs.py, so there is no master PR
that a v25.8-must-backport label could be applied to. If you would prefer this handled another
way, tell me and I will follow that.

test_jbod_balancer is still waiting on the v25.8-must-backport label on #88104 for the
range(20) -> range(200) fix.

@alexey-milovidov
alexey-milovidov merged commit 54df913 into 25.8 Aug 4, 2026
34 checks passed
@alexey-milovidov
alexey-milovidov deleted the backport/25.8/106928 branch August 4, 2026 23:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-backport Changes, backported to release branch. Do not use manually - automated use only! pr-bugfix Pull request with bugfix, not backported by default

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants