Skip to content

Backport #116992 to 26.6: Do not read the compressed-buffer slack as LZ4 literal data - #118248

Merged
clickhouse-gh[bot] merged 2 commits into
26.6from
backport/26.6/116992
Sep 5, 2026
Merged

clickhouse-gh[bot] merged 2 commits into
26.6from
backport/26.6/116992

Conversation

@robot-ch-test-poll

@robot-ch-test-poll robot-ch-test-poll commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

Original pull-request #116992

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.5.59

@robot-ch-test-poll robot-ch-test-poll added pr-backport Changes, backported to release branch. Do not use manually - automated use only! pr-critical-bugfix labels Sep 5, 2026
@clickhouse-gh

clickhouse-gh Bot commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [BackportPR], commit [1bd837f]

Summary: ✅

@alexey-milovidov

Copy link
Copy Markdown
Member

🕵 Merged 26.6 into the branch (1bd837f0) to re-run CI on an up-to-date base. The backported hunk in src/Compression/LZ4_decompress_faster.cpp is line-for-line identical to the one merged into master in #116992, and the two test files are byte-identical to the master versions.

The only red on the previous head d00ad36f was Stateless tests (amd_asan_ubsan, distributed plan, parallel, 1/2), where the server died on Logical error: 'Bucket 5 is pushed twice' in GroupingAggregatedTransform::tryPushTwoLevelData — 0 individual tests failed (1457 passed). That is unrelated to LZ4 decompression; it is tracked in #115986 and being fixed in #116446.

@groeneai, please have a look at the failure above (https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=118248&sha=d00ad36fb8ffacc2b0e7bcfd9f3b7f2fd40ad388&name_0=BackportPR&name_1=Stateless%20tests%20%28amd_asan_ubsan%2C%20distributed%20plan%2C%20parallel%2C%201%2F2%29) — if #116446 already covers it, no action is needed here.

@clickhouse-gh
clickhouse-gh Bot merged commit 3dc67d1 into 26.6 Sep 5, 2026
38 of 39 checks passed
@clickhouse-gh
clickhouse-gh Bot deleted the backport/26.6/116992 branch September 5, 2026 20:48
@groeneai

groeneai commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator

#116446 does not cover this one. It is a different route, and the 26.6 red is a gap in the 26.6/26.7 backports of #112794 rather than a flake.

The query that killed the server (id 8497ff16-fe65-4d6e-ab12-f2a16acfa013 in the job's clickhouse-server.log) is the only INSERT of 04605_parallel_replicas_merging_aggregated_bucket_order.sh:

INSERT INTO res SELECT x, sum(y) FROM d GROUP BY x
SETTINGS enable_parallel_replicas = 1, max_parallel_replicas = 3,
    parallel_replicas_for_non_replicated_merge_tree = 1, prefer_localhost_replica = 0,
    distributed_aggregation_memory_efficient = 1, group_by_two_level_threshold = 1, max_threads = 8

It never reaches the distributed-plan optimizer: across all 169 of its log lines there is no Shuffle, Scatter or Exchange step, and optimizeTree logged Some steps in the plan don't support dataflow statistics collection. Skipping optimization. #116446 only changes tryMakeDistributedAggregation in makeDistributed.cpp, so it cannot affect this query, and backporting it would leave this red unchanged.

The route belongs to #112794, whose commit 4af3bc0e9047 added two things at once: the chassert(... "Bucket {} is pushed twice") now firing at MergingAggregatedMemoryEfficientTransform.cpp:62, and the producer-side fix in applyParallelReplicas.cpp that makes the replica merge memory efficient and therefore bucket-ordered:

-            const bool memory_efficient_aggregation = false;
+            const bool memory_efficient_aggregation = optimization_settings.distributed_aggregation_memory_efficient
+                && grouping_sets_params.empty() && !new_split_node.step->getOutputHeader()->has("__grouping_set");

Both release backports dropped that second half. #115190 (26.6) and #115191 (26.7) each changed only AggregatingTransform.cpp, MergingAggregatedMemoryEfficientTransform.{cpp,h} and the two tests. 26.7 still reads const bool memory_efficient_aggregation = false; at applyParallelReplicas.cpp:95, and 26.6 does not have that file at all. So both branches received the new assertion plus the test that exercises the route it guards, without the fix that makes it hold. master and 26.8 have it, 26.8 having been cut after #112794 merged.

Two consequences worth stating:

So nothing is owed on this PR: the failure is unrelated to the LZ4 change and predates it on 26.6. What is owed is the missing applyParallelReplicas.cpp hunk on 26.6 and 26.7. Because chassert compiles out in release builds, per #112794's own comment the same double push there returns duplicated GROUP BY keys instead of aborting, which is exactly what that test's final query checks. I am leaving the backport disposition to you rather than hand-authoring a release-branch change.

For completeness on the attribution: #116446 is mine and still open. It fixes the distributed-plan Shuffle route on master, which is the surviving GroupingAggregatedTransform pushed bucket N twice signature there, and not this one.

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-critical-bugfix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants