Skip to content

Stabilize storage memory checkpoints and report unfiltered allocations - #129357

Open
qoega wants to merge 1 commit into
ClickHouse:masterfrom
qoega:codex/storage-memory-checkpoints-20260929
Open

qoega wants to merge 1 commit into
ClickHouse:masterfrom
qoega:codex/storage-memory-checkpoints-20260929

Conversation

@qoega

@qoega qoega commented Nov 4, 2026 •

Copy link
Copy Markdown
Member

Storage-memory checkpoints can capture unfinished worker cleanup, while broad ThreadStatus exclusions hide real worker allocations. Pause scheduled producers, drain executor cleanup, and keep scheduling paused through heap capture. Add optional worker controls and unfiltered startup/retained-memory reporting.

Alternative to #121545, which fences executor scheduling. This approach also controls lazy worker participation. The existing filtered CI gate remains until the reference binary supports identical controls; raw totals are informational meanwhile.

Validation on aarch64 with -O3 and ThinLTO: 34 processes, 646 heaps, and 404 focused test executions passed. Across five final controlled runs, the largest scenario spread was 336 B; the multiple-table outlier fell from 33,024 B to 8 B. A dev-only probe confirmed that raw reporting retains a real worker’s 4 KiB allocation that the existing filter hides. Retaining the active-parts loader costs 48,840 B in median first-pass retained memory. Full sanitizer/tidy CI and executor-latency validation remain outstanding.

Related: #121545
Related: #121364

Observed regression: https://s3.amazonaws.com/clickhouse-test-reports/PRs/118532/4c71c8c4d3cd0887b2e89d5437e7721c6435fc99/pr/storage_memory_check/storage_memory_report.html

Changelog category (leave one):

  • CI Fix or Improvement (changelog entry is not required)

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

Stabilize storage-memory checkpoints and report unfiltered allocations, including startup and retained worker state.


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

@clickhouse-gh

clickhouse-gh Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [b2f9b69]

Summary: ✅


AI Review

Summary

PR #129357, reviewed at b2f9b69c5ed52213f4ca4ba12461aef5f85a784c, pauses scheduled producers and drains executor cleanup before storage-memory checkpoints, adds optional worker controls, and publishes unfiltered allocation totals. No actionable correctness findings were identified in the current diff or its surrounding execution and cleanup paths. There were no previous review threads.

Missing context / blind spots
  • ⚠️ Current-head sanitizer/unit-test and storage-memory CI results were not available during review. The PR reports focused local validation, but completion of those CI jobs is still needed to confirm the full configuration. No local build was available to rerun the C++ tests.
  • ⚠️ The PR explicitly leaves executor-latency validation outstanding. A focused before/after measurement would establish the cost of the additional idle-worker accounting and notifications in the production executor loop.
Final Verdict

Status: ✅ Approve — no actionable code changes requested; the validation limits above remain.

@clickhouse-gh clickhouse-gh Bot added pr-ci comp-ci-infrastructure CI/CD pipelines (GitHub Actions, CI scripts, runners). labels Nov 4, 2026
@clickhouse-gh

clickhouse-gh Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Build profile diff (arm_release)

Comparing b2f9b69c5 with master cb8ea0ea9 (stripped binary size, per-symbol sizes and ThinLTO time; object sizes against the warmup build of 6398cafb6; 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.

Object file sizes

27 object files changed (+69.86 KiB total), 0 added.

Object file Master PR Δ
src/Examples/CMakeFiles/clickhouse-examples.dir/storage_memory_profiler.cpp.o 179.48 KiB 216.18 KiB +36.70 KiB (+20.45%)
src/CMakeFiles/dbms.dir/Storages/MergeTree/MergeTreeBackgroundExecutor.cpp.o 325.18 KiB 345.49 KiB +20.31 KiB (+6.25%)

719 more object files are built by the master warmup baseline only (it builds every object-file target, a pull request build only clickhouse-bundle) and not compared.

Compile time of recompiled translation units

392 translation units recompiled, 4010 s compile time in total, 392 of them have a recent master baseline.

Median compile-time ratio to the baselines is ×0.95 (machine-speed difference or a change affecting every TU); per-TU deltas below are relative to that ratio.
The matched translation units cost -229.4 s (-5%) in total before that adjustment.

Job report

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp-ci-infrastructure CI/CD pipelines (GitHub Actions, CI scripts, runners). pr-ci

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant