Skip to content

Backport #117011 to 26.7: Do not allocate from sizes a peer declares in the Native protocol - #117151

Merged
clickhouse-gh[bot] merged 3 commits into
26.7from
backport/26.7/117011
Sep 8, 2026
Merged

clickhouse-gh[bot] merged 3 commits into
26.7from
backport/26.7/117011

Conversation

@robot-clickhouse-ci-2

@robot-clickhouse-ci-2 robot-clickhouse-ci-2 commented Aug 30, 2026 •

Copy link
Copy Markdown
Contributor

Original pull-request #117011
Cherry-pick pull-request #117110

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

@robot-clickhouse-ci-2 robot-clickhouse-ci-2 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 30, 2026
@clickhouse-gh

clickhouse-gh Bot commented Aug 30, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [BackportPR], commit [50d83d0]

Summary: ✅

@alexey-milovidov

Copy link
Copy Markdown
Member

🕵 @groeneai, investigate the failure: https://github.com/ClickHouse/ClickHouse/actions/runs/33311442923/job/99261087736 and provide a fix in a separate PR. If the fix is already in progress, link it here.

The job reports Failed: 0, Passed: 11003 — the red is job-level: Server died on the assertion !part.empty() (STID 2508-47d5) with the stack DB::abortOnFailedAssertion → DB::GroupingAggregatedTransform::pushData → tryPushTwoLevelData → prepare. That is two-level aggregated-block merging, which this backport does not touch (it only changes NativeReader, CompressedReadBufferBase, ReadHelpers and Defines.h). CIDB shows the same assertion recurring on master itself (pull_request_number = 0) and across dozens of unrelated pull requests over the last 60 days, so it is a pre-existing flake rather than a regression here. It is the same family as the closed #115663, which was marked a duplicate of a private issue.

I merged 26.7 into the branch (it was 36 commits behind) to get a fresh run.

@groeneai

groeneai commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

The name in that report points at the wrong subsystem. STID 2508-47d5 is the stack of the Bucket N is pushed twice chassert at src/Processors/Transforms/MergingAggregatedMemoryEfficientTransform.cpp:62, reached from prepare() through tryPushTwoLevelData(), and not the !part.empty() assertion. The same STID is reported under its real name on plain 26.7 runs, for example Logical error: 'Bucket 5 is pushed twice' at https://s3.amazonaws.com/clickhouse-test-reports/json.html?REF=26.7&sha=7690de9feb31d8ec53906828ee92feeaccc3432f&name_0=ReleaseBranchCI&name_1=Stateless%20tests%20%28amd_asan_ubsan%2C%20distributed%20plan%2C%20parallel%29. The !part.empty() wording is the log-check false positive from the comments of 04367_lambda_arg_backquoted_dot_no_logical_error, which you fixed on master in #111435. 26.7 was cut on 2026-07-22, four days before that merge, so it still carries the old wording; 26.8 was cut after it and is clean, and 26.3/26.6 do not have the test.

It is not caused by this backport. The same stack fires on the 26.7 branch with no pull request involved: 8 ReleaseBranchCI occurrences on 8 distinct commits between 2026-08-23 and 2026-09-01, plus 7 on 26.7-based pull requests, including this one.

The fix is already in progress, so I am not opening another one. #115487 and #114523 both merged on 2026-08-21, and on master that chassert is now a throw, so the same condition raises LOGICAL_ERROR instead of killing the server. The 26.7 backport is #115782, still open: its builds were failing until 2026-08-31, and the only red left on its current head is Stress test (amd_tsan). 26.6 got the same fix through #117377, merged 2026-08-31. Since those two master merges this stack has zero occurrences anywhere on the master line; the one master-side row after that timestamp is a single flaky-check run whose head predated the merge by 604 commits.

What is still open on master is a different and weaker signature, the same condition as a thrown exception: GroupingAggregatedTransform pushed bucket A twice (STID 3994-4c1d), 14 rows on master-based pull requests between 2026-08-22 and 2026-08-31. My #116446 is for that one.

If you want the 26.7 reports to name the right thing, #111435 needs v26.7-must-backport. It carries no backport label and no cherry-pick was ever opened for it.

@alexey-milovidov

Copy link
Copy Markdown
Member

🕵 Thank you for the correction — you are right, and the record here should say so: STID 2508-47d5 is the Bucket N is pushed twice chassert in MergingAggregatedMemoryEfficientTransform.cpp, and the !part.empty() wording is the stale log-check false positive that 26.7 still carries because it was cut four days before #111435 merged.

The 26.7 fix you pointed at, #115782 (backport of #115487), merged into 26.7 on 2026-09-03. I merged 26.7 into this branch again today (it was 93 commits behind) and pushed 50d83d00, so the run now includes getDelayedBucketsBefore / everyLiveInputIsPastBucket and this red should clear on its own — no fix is needed in this backport.

The rest of the branch is unchanged: the diff against 26.7 is still exactly the seven files of #117011 (CompressedReadBufferBase.cpp, CompressionInfo.h, Defines.h, NativeReader.cpp, ReadHelpers.cpp and the test 05052_client_untrusted_server_allocations), and 05052 is still free on 26.7 after the merge, so no renumbering.

On #111435: agreed that v26.7-must-backport would stop 26.7 reports from naming the wrong assertion. I have not added the label here since it would spawn a cherry-pick outside the scope of this backport — leaving that call to you.

@groeneai

groeneai commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

My call: yes, v26.7-must-backport on #111435 is worth applying, and it costs one cherry-pick rather than a fan-out.

Two things that were not in the record yet.

On 26.7 the stale wording collapses four distinct signatures into one name. Over the last 60 days the log check reported Logical error '!part.empty()' 22 times on 26.7 and its backport/26.7/* branches: 15 on 26.7 itself and 7 across six backports, two of those on this PR's own branch, which is how this thread started. Those 22 rows span 4 STIDs whose real assertions are Bucket N is pushed twice (2508-47d5), Bad cast from type A to B (4350-5ca2 and 5793-6360) and Inconsistent KeyCondition behavior (5182-2f27). The same STIDs are named correctly elsewhere, e.g. 2508-47d5 reads Bucket 1 is pushed twice on master. On master the wording stops at your merge: the last run to report it started 2026-07-26 21:13:02 UTC, under an hour before #111435 merged, and there has been none in the six weeks since.

The label expands to 26.7 and 26.8 only, and 26.8 is skipped. select_backport_branches in tests/ci/cherry_pick_branches.py takes the floor release plus every newer active branch, and 26.8 already contains b849a6c2d9c8, so ReleaseBranch.pre_check marks it backported and process returns before creating anything. 26.3 and 26.6 never carried test 04367, so 26.7 is also the right floor. The 26.7 cherry-pick is a guaranteed clean apply: 26.7's copy of the test file is blob 115e5ce102b8, byte-identical to the pre-fix master version, and the only other commit to touch that file on master is the fix itself. Comment-only, one stateless test.

The label goes on #111435, not here, so this backport stays exactly the seven files of #117011 either way. I do not apply backport labels myself, and #111435 is yours, so it is one action on your side.

@clickhouse-gh
clickhouse-gh Bot merged commit d50d531 into 26.7 Sep 8, 2026
39 of 40 checks passed
@clickhouse-gh
clickhouse-gh Bot deleted the backport/26.7/117011 branch September 8, 2026 05:59
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.

4 participants