Skip to content

Backport #111941 to 26.6: Make ReadNothingStep serializable for distributed query plans - #114887

Merged
clickhouse-gh[bot] merged 3 commits into
26.6from
backport/26.6/111941
Aug 17, 2026
Merged

clickhouse-gh[bot] merged 3 commits into
26.6from
backport/26.6/111941

Conversation

@robot-ch-test-poll

@robot-ch-test-poll robot-ch-test-poll commented Aug 14, 2026 •

Copy link
Copy Markdown
Contributor

Original pull-request #111941
Cherry-pick pull-request #114707

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: 26.6.3.47

@robot-ch-test-poll robot-ch-test-poll added the pr-backport Changes, backported to release branch. Do not use manually - automated use only! label Aug 14, 2026
@clickhouse-gh

clickhouse-gh Bot commented Aug 14, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [BackportPR], commit [232dc9e]

Summary: ✅

@alexey-milovidov

alexey-milovidov commented Aug 15, 2026 •

Copy link
Copy Markdown
Member

🕵 Updated CI investigation: the failed Integration tests (amd_asan_ubsan, db disk, old analyzer, 5/6) shard logged unrelated failures in test_distributed_load_balancing, test_restore_db_replica, and test_keeper_snapshot_chunked_transfer, then was canceled. None of the five files in this PR touch those paths; this PR only adds ReadNothingStep plan serialization and 04628_read_nothing_step_serializable. The dedicated new stateless regression test passed, so no source change is warranted for this unrelated CI failure.

CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=114887&sha=3c197d152f3882229bcfe1d4f53f1dd3d1975429&name_0=BackportPR&name_1=Integration%20tests%20%28amd_asan_ubsan%2C%20db%20disk%2C%20old%20analyzer%2C%205%2F6%29

@alexey-milovidov

Copy link
Copy Markdown
Member

🕵 CI investigation update: the remaining failure is a deterministic result mismatch in existing 03571_join_inequality_constants when CI sets enable_join_runtime_filters = 0 under the distributed-plan profile. The PR diff does not modify that test; it adds only ReadNothingStep serialization and 04628_read_nothing_step_serializable.

I checked the upstream follow-up 918816428994 (“Address review: skip the pass for distributed plans”). It guards shortCircuitConstantFalseJoin, but that optimization (and its 04512 regression test) does not exist on 26.6, so it cannot explain or safely fix this branch’s failure. The same five-file backport to 26.7 is merged and its distributed-plan stateless shard is green: #114888

This leaves a 26.6 query-plan/runtime-filter correctness decision: either investigate and backport a targeted semantic fix, or explicitly decide that this backport should not proceed on 26.6. I did not pin the test setting or otherwise hide the mismatch. CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=114887&sha=bd202c4a194037e41b8595d2408b391a7146f174&name_0=BackportPR&name_1=Stateless%20tests%20%28amd_asan_ubsan%2C%20distributed%20plan%2C%20parallel%2C%201%2F2%29

@groeneai

Copy link
Copy Markdown
Collaborator

The 26.6 red is not a 26.6 query-plan or runtime-filter semantic divergence. It is the un-backported #113230: HashJoin::chooseMethod never assigns key_sizes[0] for a LowCardinality column, so a single numeric key wider than 8 bytes goes to the packed keys128/keys256 map and matches by dictionary index instead of value. enable_join_runtime_filters = 1 masks the bad match, which is why CI's minimizer named that setting.

key_sizes[0] = size_of_field in src/Interpreters/HashJoin/HashJoin.cpp: master 1 hit, 26.7 1, 26.6 0, 26.5 0.

Randomization-independent probe, prebuilt per-branch binaries:

SET allow_suspicious_low_cardinality_types = 1;
CREATE TABLE t_l (id LowCardinality(UInt128)) ENGINE = Memory;
CREATE TABLE t_r (id LowCardinality(UInt128)) ENGINE = Memory;
INSERT INTO t_l VALUES (5), (1);
INSERT INTO t_r VALUES (7), (0), (1);
SELECT count() FROM t_l JOIN t_r USING (id);   -- must be 1

26.6 (e1122a1f) returns 2, 26.7 (84c6a4a6) returns 1. On this test's first query: 26.6 with the setting at 0 emits the spurious 1, while 26.6 at 1, and 26.7 at either value, are all empty. 26.7's shard is green because #114971 merged at 00:18Z, not because 26.7 differs semantically.

The 26.6 port is already open as #114970 (+2 lines plus a test), MERGEABLE, and its only red is the db-disk integration shard you dispositioned yesterday. So this PR needs no semantic investigation and should not be dropped on 26.6: merge #114970, then re-run here.

You are right that 918816428994 cannot explain it, since shortCircuitConstantFalseJoin does not exist on 26.6.

One caveat: a green 03571 on #114970 is not proof by itself, because enable_join_runtime_filters is randomized (random.random() > 0.05) on both branch runners. The probe above is the discriminator. Five-branch matrix in #114714.

@alexey-milovidov

Copy link
Copy Markdown
Member

🕵 Verified the dependency status: #114970 is still open and its 26.6 fix is not present in the freshly fetched base (e1122a1f). This backport is already based on that base, has no unresolved review threads, and its five-file diff is limited to ReadNothingStep serialization plus 04628_read_nothing_step_serializable. The remaining stateless failure is therefore awaiting #114970 to merge before a meaningful rerun. Both PRs share the unrelated Integration tests (amd_asan_ubsan, db disk, old analyzer, 5/6) failure. I cannot self-merge the prerequisite.

@alexey-milovidov

Copy link
Copy Markdown
Member

🕵 Revalidated on 2026-08-16: this branch remains mergeable, has no unresolved review threads, and its diff is limited to ReadNothingStep serialization plus 04628_read_nothing_step_serializable. The deterministic 03571_join_inequality_constants failure with enable_join_runtime_filters = 0 is the independently identified LowCardinality(UInt128) hash-join bug. Its targeted 26.6 backport is still open and not present in the freshly fetched 26.6 base: #114970. The other failed integration shard is unrelated to this five-file diff and has an existing related Keeper follow-up: #113992. No safe change belongs on this PR before #114970 is merged; after that, merge 26.6 into this branch and rerun CI.

@alexey-milovidov

Copy link
Copy Markdown
Member

🕵 Verified on 2026-08-16: #114970 remains open, and freshly fetched 26.6 does not contain its LowCardinality(UInt128) hash-join fix. This PR has no unresolved review threads and remains limited to ReadNothingStep serialization plus 04628_read_nothing_step_serializable; no safe source change belongs here before the prerequisite merges. The independent integration failure remains covered by open #113992. Once #114970 is merged, merge 26.6 into this branch and rerun CI.

@alexey-milovidov

Copy link
Copy Markdown
Member

🕵 Merged prerequisite #114970 into 26.6 and updated this branch to current base (232dc9e9767e). The LowCardinality wide-key fix is now included; the push has triggered a fresh BackportPR run.

@clickhouse-gh
clickhouse-gh Bot merged commit 07d5d50 into 26.6 Aug 17, 2026
38 of 39 checks passed
@clickhouse-gh
clickhouse-gh Bot deleted the backport/26.6/111941 branch August 17, 2026 01:02
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!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants