Skip to content

Revert "Revert "Do not allocate from peer-declared sizes when reading settings from the Native protocol"" - #120931

Merged
alexey-milovidov merged 2 commits into
masterfrom
revert-120930-revert-118612-groeneai/settings-wire-no-allocation-from-declared-size
Sep 19, 2026
Merged

alexey-milovidov merged 2 commits into
masterfrom
revert-120930-revert-118612-groeneai/settings-wire-no-allocation-from-declared-size

Conversation

@alexey-milovidov

@alexey-milovidov alexey-milovidov commented Sep 18, 2026 •

Copy link
Copy Markdown
Member

Reverts #120930


Workflow [PR]
Sync PR [sync-upstream/pr/120931]

Version info

  • Merged into: 26.10.1.144-master (included in 26.10 and later)
  • Backported to: 26.9.13.12, 26.8.21.7, 26.7.25.6, 26.3.45.2

@clickhouse-gh

clickhouse-gh Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [4137c11]

Summary: ✅


AI Review

Summary

This PR reverts #120930 and restores readStringBinaryGrowing for the string carriers currently reachable from settings and query-parameter decoding on the Native protocol, plus focused gtest coverage that clamps memory and verifies truncated peer-declared lengths fail with ATTEMPT_TO_READ_AFTER_EOF instead of turning the declared size into an allocation. I did not find a remaining correctness or safety issue in the touched paths, and the current PR discussion has no prior review threads to carry forward.

Final Verdict

✅ No blocking or major issues found in the current diff. The revert restores the intended hardening and the added tests cover the relevant decoding shapes.

LLVM Coverage Report

Measured on commit 4137c11.

Metric Baseline Current Δ
Lines 88.40% 88.40% +0.00%
Functions 91.80% 91.80% +0.00%
Branches 80.60% 80.70% +0.10%

Changed lines: Changed C/C++ lines covered: 115/128 (89.84%) · Uncovered code

Full report · Diff report

@clickhouse-gh clickhouse-gh Bot added the pr-not-for-changelog This PR should not be mentioned in the changelog label Sep 18, 2026
@clickhouse-gh clickhouse-gh Bot added the comp-settings Settings & configuration infrastructure (server/user/query settings, profiles). label Sep 19, 2026
@clickhouse-gh

clickhouse-gh Bot commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

Build profile diff (arm_release)

Comparing 4137c1161 with master b810ea7fc (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

programs/clickhouse-stripped: smaller than the master baseline by the known offset between the two builds, so the difference is not shown. A delta that differs from the offset by more than 50% of it is shown, in either direction.

The official master build is compiled with -g and a pull request build is not, and XRay counts debug instructions towards its instrumentation threshold, so master instruments thousands of functions more and its binary is ~0.4% larger no matter what the pull request does.

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

@alexey-milovidov alexey-milovidov self-assigned this Sep 19, 2026
@alexey-milovidov
alexey-milovidov added this pull request to the merge queue Sep 19, 2026
Merged via the queue into master with commit 015bf12 Sep 19, 2026
176 checks passed
@alexey-milovidov
alexey-milovidov deleted the revert-120930-revert-118612-groeneai/settings-wire-no-allocation-from-declared-size branch September 19, 2026 07:07
@robot-clickhouse-ci-1 robot-clickhouse-ci-1 added the pr-synced-to-cloud The PR is synced to the cloud repo label Sep 19, 2026
@nickitat nickitat added the pr-must-backport Pull request should be backported intentionally. Use this label with great care! label Oct 7, 2026
@robot-ch-test-poll3 robot-ch-test-poll3 added the pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR label Oct 7, 2026
clickhouse-gh Bot added a commit that referenced this pull request Oct 7, 2026
Backport #120931 to 26.9: Revert "Revert "Do not allocate from peer-declared sizes when reading settings from the Native protocol""
alexey-milovidov added a commit that referenced this pull request Oct 8, 2026
…ypick/26.7/120931

Resolve the conflict in `src/Core/tests/gtest_settings.cpp` by taking the 26.7
version of the file and adding only the tests and includes introduced by
#120931; the master-only tests in
the conflicting hunk are not part of this backport.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
robot-ch-test-poll added a commit that referenced this pull request Oct 8, 2026
Cherry pick #120931 to 26.7: Revert "Revert "Do not allocate from peer-declared sizes when reading settings from the Native protocol""
robot-clickhouse added a commit that referenced this pull request Oct 8, 2026
…eclared sizes when reading settings from the Native protocol""
robot-ch-test-poll added a commit that referenced this pull request Oct 8, 2026
Cherry pick #120931 to 26.8: Revert "Revert "Do not allocate from peer-declared sizes when reading settings from the Native protocol""
robot-clickhouse added a commit that referenced this pull request Oct 8, 2026
…eclared sizes when reading settings from the Native protocol""
alexey-milovidov added a commit that referenced this pull request Oct 8, 2026
Resolve the conflict in `src/Core/tests/gtest_settings.cpp`: take the 26.3
version of the file and add the tests from #120931. The release branch has no
`CurrentMemoryTracker::setMinAllocationSizeBytesToThrow` (so `operator new`
never throws on the memory limit there), so the tests now read the settings in
a separate thread with its own `ThreadStatus` and check the peak of its memory
tracker instead of arming a memory limit.
robot-clickhouse added a commit that referenced this pull request Oct 8, 2026
Cherry pick #120931 to 26.3: Revert "Revert "Do not allocate from peer-declared sizes when reading settings from the Native protocol""
robot-clickhouse added a commit that referenced this pull request Oct 8, 2026
…eclared sizes when reading settings from the Native protocol""
@robot-clickhouse-ci-2 robot-clickhouse-ci-2 added the pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore label Oct 8, 2026
clickhouse-gh Bot added a commit that referenced this pull request Oct 8, 2026
Backport #120931 to 26.8: Revert "Revert "Do not allocate from peer-declared sizes when reading settings from the Native protocol""
clickhouse-gh Bot added a commit that referenced this pull request Oct 8, 2026
Backport #120931 to 26.7: Revert "Revert "Do not allocate from peer-declared sizes when reading settings from the Native protocol""
PedroTadim added a commit that referenced this pull request Oct 8, 2026
Backport #120931 to 26.3: Revert "Revert "Do not allocate from peer-declared sizes when reading settings from the Native protocol""
kewin-robetti pushed a commit to viasoftkorp/ClickHouse that referenced this pull request Oct 9, 2026
…rom peer-declared sizes when reading settings from the Native protocol""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp-settings Settings & configuration infrastructure (server/user/query settings, profiles). pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore pr-must-backport Pull request should be backported intentionally. Use this label with great care! pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR pr-not-for-changelog This PR should not be mentioned in the changelog 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.

5 participants