Repository navigation
Add "Build profile diff" check: compare PR build profile against master - #111164
Conversation
A new PR-workflow job compares the aarch64 release build of the PR
against the latest master build using the CI logs cluster, and posts
(and keeps updated) a PR comment when there is a significant change:
* sizes of the final binaries (clickhouse, stripped, self-extracting,
keeper) and of every intermediate .o file;
* per-symbol sizes of the final binaries;
* link time and per-function ThinLTO optimization time
(down to individual functions and template instantiations);
* per-TU compile time of the translation units the PR recompiled,
with per-entity drill-down (template instantiations, headers),
normalized by the median ratio to filter out machine-speed skew.
Supporting changes:
* build_profile_hook.py no longer skips PRs: the arm_release build
uploads profile data for PRs too (the reason PR data was absent was
an explicit pr_number == 0 gate). PR time traces are uploaded
reduced - only the event kinds the diff consumes - because the bulk
of a full trace is per-pass LLVM events of the ThinLTO link that
nobody reads, and PR builds are far more frequent than master ones.
* prepare-time-trace.sh also collects symbols of the final linked
binaries with nm: (Thin)LTO release builds skip nm on .o files, so
binary_symbols had no rows at all for amd_release/arm_release.
* LogCluster gains a select method (query in the request body, with
retries tolerating the cluster's minutes-long memory-pressure
spikes) and explicit url/user/password overrides for local runs.
Validated locally against real data: an adjacent-master pair shows the
noise floor (binary sizes within ~100 bytes, link time within a few
percent, verdict "no significant changes"), and the type-pair kernel
pruning commit (4ed98f9) is correctly flagged: -54.84 MiB stripped
binary, the pruned HashJoin instantiation .o files at -48%, link time
-24%/-34%.
Co-Authored-By: Claude Fable 5 <[email protected]>
|
Workflow [PR], commit [05d316e] Summary: ✅
AI ReviewSummaryThis PR adds a new Missing context / blind spots
Final Verdict✅ No new blocker or major findings on the current PR head. |
…I logs cluster credentials from AWS SSM and test-base has no `aws` CLI The job failed with `/bin/bash: line 1: aws: command not found` because `Secret.get_aws_ssm_parameter` shells out to the AWS CLI, which the `clickhouse/test-base` image does not ship. `clickhouse/stateless-test` extends test-base and installs the AWS CLI; stateless test jobs already fetch these same secrets inside that image, so in-container IMDS access is proven to work. Also address the review findings: - scope each comparison side to the newest uploaded build run: a rerun of `Build (arm_release)` re-inserts the whole dataset under the same pull_request_number/commit_sha/check_name, and mixing runs corrupts the aggregations (sums double, max picks the slowest rerun); - cover `clickhouse-keeper` in the per-symbol diff (keyed by file, symbol), comparing each binary only when both sides have its symbol data; - add `utils/prepare-time-trace/prepare-time-trace.sh` and `ci/jobs/scripts/log_cluster.py` to the build digest so the producing build reruns when the profile producer/upload path changes. CI: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=111164&sha=4e62df6112628621fc1d6535da72526f7b352409&name_0=PR PR: #111164 Co-Authored-By: Claude Fable 5 <[email protected]>
|
The The |
Address the AI review findings on the `Build profile diff` check. Major 1 (cross-run mixing): the newest `(check_start_time, instance_id)` was resolved independently per table via a per-table `latest_run` subquery. Because the producer uploads `binary_sizes`, `build_time_trace`, and `binary_symbols` independently and skips genuinely-empty artifacts, a rerun that uploaded only some tables let the size/link sections read the newest run while `compare_symbols` silently fell back to an older run. Each side is now pinned to one concrete build run once (`resolve_run`, from the canonical `binary_sizes` table) and that `(check_start_time, instance_id)` is reused across every table (new `Side` dataclass). A table missing for that run reads as absent instead of falling back to a different run. Major 2 (false-green on consumer-only change): `Build (arm_release)` is cacheable under a digest that does not include `build_profile_diff_job.py`, so a change to the consumer alone could get a cache hit, upload no rows for the new commit, and return a green "no data" result without exercising the changed SQL. Added `ci/tests/test_build_profile_diff_job.py`: fixture-backed tests that run the real query builders against `clickhouse local`, seeding two PR reruns with the newest run missing the symbol table plus a no-PR-data (cache-hit) case. They assert the pinned run is the newest, that sizes come from it, and that symbols are not read from an older run. The `CI Tests` job digest is `./ci`, so a consumer-only change re-runs these tests and can no longer merge on a false green. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
Addressed both AI-review Majors in ebc594f: Cross-run mixing: each side is now pinned to a single build run once — False-green on consumer-only change: added |
maxknv
left a comment
There was a problem hiding this comment.
OK, but I think this implementation has many reasons to be unreliable.
I think relying on LogCluster is good for post-analysis, but not as a check in CI.
I'd suggest using profile data directly and bypassing LogCluster entirely for comparison.
New Artifact object can be created with this profile data. It's provided by the build job and required by the new comparison. The reference data from the master can be retrieved from s3 in the job.
It would be stable from day one, easier to run locally and maintain, and much more reliable, require no AWS secrets and CI infra.
|
|
||
| summaries = [s.summary or s.title for s in significant] | ||
| result_info = "Significant changes: " + "; ".join(summaries) if significant else f"No significant changes vs master {base_sha[:9]}" | ||
| Result.create_from(status=Result.Status.OK, info=result_info).complete_job() |
There was a problem hiding this comment.
nitpick: if we write each sub-check (compile time, link time, size, etc) as a separate Result object in the job's Result.results array, it might be beneficial as they are all written into the cidb. Also, it should look clearer in the CI report.
There was a problem hiding this comment.
Done - each comparison aspect is its own Result in the job's Result.results (see the sub_results list at the end of main()), so they land as separate rows in cidb and as separate lines in the CI report: Binary sizes, Object file sizes, Slowest function optimization changes (ThinLTO), Compile time of recompiled translation units, Symbol sizes.
| """ | ||
| shas = [] | ||
| seen = set() | ||
| for sha in list(info.get_kv_data("master_commits") or []): |
There was a problem hiding this comment.
- The correct "kv data" to use is master_track_commits_sha (not master_commits). It includes 100 master commits, topped by the commit included in ephemeral GH's merge-commit, where CI runs.
- Why do we need to fill it up to 600 commits from gh api, then, if we still only check the first 100 later, and then pick up only one from them? or i misunderstood smth..
There was a problem hiding this comment.
get_master_shas still falls back to master_commits in ci/jobs/build_profile_diff_job.py:341-343. That means a missing master_track_commits_sha no longer fails closed: find_baseline / find_warmup_baseline will walk the global master tip instead of the PR's master-parent chain.
store_data.py already has a warning path at ci/jobs/scripts/workflow_hooks/store_data.py:77-99 when HEAD^1 / git rev-list cannot produce that anchored chain, so this is not just a theoretical path. In that case the job can compare the PR against a commit newer than its merge base and attribute unrelated master changes to the PR. This still needs to raise in CI rather than silently downgrade to master_commits; only the explicit --local --base-sha path has a safe fallback.
There was a problem hiding this comment.
master_track_commits_sha is now the only CI baseline chain; the old fallback to master_commits is gone.
gh api still has one job: master_track_commits_sha holds only the newest ~100 anchored master SHAs, which is enough for the 7-day release baseline but not for the 14-day per-TU warmup lookup. extend_master_shas pages older ancestors from GitHub only for that longer TU window (and --local --base-sha uses the same API because it has no CI kv metadata at all).
| try: | ||
| raw = subprocess.run( | ||
| [ | ||
| "gh", |
There was a problem hiding this comment.
Purpose of gh api is not clear...
There was a problem hiding this comment.
Answered in the thread above: master_track_commits_sha is now the only baseline chain in CI. gh api has one remaining job - that kv value holds only the newest ~100 anchored master SHAs, which covers the 7-day release baseline but not the 14-day per-TU warmup lookup, so extend_master_shas pages older ancestors from GitHub for that longer window only. A local run (--local --base-sha) uses the same API because it has no CI kv metadata at all.
…n pinning, new-TU significance Addresses the unresolved review findings on #111164: - `maxknv`: `get_master_shas` now reads `master_track_commits_sha` (the PR's master-parent chain, anchored to the merge base) instead of `master_commits` (the global tip), and drops the `gh api` fill-to-600 loop — `find_baseline` only ever considers the first 100 candidates and the `store_data` hook already stores ~100, so paging more was dead weight. - `clickhouse-gh`: `drill_down_tu` no longer re-resolves the baseline run from the commit sha alone. `compare_compile_times` now carries the exact winning `(check_start_time, instance_id)` out of `base_rows` and hands the pinned `Side` to the drill-down, so it reads the TU's entities from the run that actually recompiled it. A later rerun of the same master commit that did not touch this TU no longer pins the drill-down to a run with no rows for the file (which reported every PR entity as `new`). - `clickhouse-gh`: an expensive translation unit without a recent master baseline now marks its section significant and populates the summary — a missing baseline must not silence a large new compile-time cost in the top-level verdict. Extends `ci/tests/test_build_profile_diff_job.py` with fixture-backed tests for each of the three behaviors. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
Addressed the outstanding review findings in
Added fixture-backed tests for all three in Still open for your call, @maxknv: the higher-level design question of whether to bypass the CI logs cluster entirely and compare against a build-provided profile artifact + S3 reference. That's a larger direction change I've left for you to decide rather than reworking unilaterally. |
|
@maxknv, about that comment, it is an ideological direction. I want to use ClickHouse more and files less. TLDR: files are bad, ClickHouse is good. |
Build profile diff (arm_release)Comparing Binary sizes
Only the stripped binary is compared: the official master build keeps debug symbols while PR builds strip them, so the other binaries differ by construction. Object file sizesNo master baseline from the warmup build yet (it is the only master build compiled with the PR's flags, profiled since this check was introduced); the comparison will activate once master catches up. Slowest function optimization changes (ThinLTO)
|
| Binary | Function | Master | PR | Δ vs median |
|---|---|---|---|---|
programs/clickhouse-keeper |
DB::SettingsTraits::Accessor::instance()::$_0::operator()() const [clone .llvm.14238646256509887658] |
new | 16.2 s | +16.2 s |
programs/clickhouse |
DB::SettingsTraits::Accessor::instance()::$_0::operator()() const [clone .llvm.15310835701980635540] |
8.6 s | gone | -9.9 s (-100%) |
programs/clickhouse-keeper |
DB::SettingsTraits::Accessor::instance()::$_0::operator()() const [clone .llvm.15310835701980635540] |
8.4 s | gone | -9.6 s (-100%) |
programs/clickhouse |
DB::SettingsTraits::Accessor::instance()::$_0::operator()() const [clone .llvm.14238646256509887658] |
new | 6.3 s | +6.3 s |
programs/clickhouse-keeper |
DB::registerFunctionConversion(DB::FunctionFactory&) |
6.7 s | 13.9 s | +6.2 s (+81%) |
programs/clickhouse-keeper |
_GLOBAL__sub_I_TargetLibraryInfo.cpp |
5.8 s | 11.2 s | +4.6 s (+69%) |
programs/clickhouse |
DB::getSettingsChangesHistory()::$_0::operator()() const |
4.7 s | 2.4 s | -2.9 s (-54%) |
programs/clickhouse |
DB::Parquet::writeColumnChunkBody(DB::Parquet::ColumnChunkWriteState&, DB::Parquet::WriteOptions co… |
5.4 s | 3.4 s | -2.8 s (-46%) |
programs/clickhouse-keeper |
DB::ServerSettingsTraits::Accessor::instance()::$_0::operator()() const [clone .llvm.41530897155626… |
new | 2.6 s | +2.6 s |
programs/clickhouse-keeper |
DB::MergeTreeSettingsTraits::Accessor::instance()::$_0::operator()() const [clone .llvm.12816159879… |
new | 2.4 s | +2.4 s |
programs/clickhouse |
DB::Aggregator::writeToTemporaryFile(DB::AggregatedDataVariants&, unsigned long) const |
3.6 s | 1.7 s | -2.4 s (-58%) |
programs/clickhouse |
DB::attachSystemTablesServer(std::__1::shared_ptr<DB::Context const>, DB::IDatabase&, bool, bool) |
4.5 s | 2.9 s | -2.3 s (-44%) |
programs/clickhouse |
DB::ServerSettingsTraits::Accessor::instance()::$_0::operator()() const [clone .llvm.12822858084705… |
1.9 s | gone | -2.2 s (-100%) |
programs/clickhouse |
DB::MergeTreeSettingsTraits::Accessor::instance()::$_0::operator()() const [clone .llvm.10544783980… |
1.8 s | gone | -2.1 s (-100%) |
programs/clickhouse-keeper |
DB::ServerSettingsTraits::Accessor::instance()::$_0::operator()() const [clone .llvm.12822858084705… |
1.8 s | gone | -2.1 s (-100%) |
programs/clickhouse-keeper |
_GLOBAL__sub_I_sqid.cpp |
1.7 s | 4.0 s | +2.0 s (+105%) |
programs/clickhouse-keeper |
DB::registerFunctionVectorFunctions(DB::FunctionFactory&) |
2.3 s | 4.6 s | +2.0 s (+78%) |
Compile time of recompiled translation units
No master baseline from the warmup build yet (it is the only master build compiled with the PR's flags, profiled since this check was introduced); the comparison will activate once master catches up.
Symbol sizes
No symbol data for the master baseline yet (it is collected for release builds only since this check was introduced); the comparison will activate once master catches up.
I understand the direction, and it's great to move this way. |
…a comment The check's first real run exposed that a PR build and an official master build are not directly comparable: PR ThinLTO builds compile with -DDISABLE_ALL_DEBUG_SYMBOLS=1 (and without the official-build flag) while master keeps debug symbols, so on a no-op PR the comment reported an apparent -73% binary size, -78% object sizes and -39% link time. Fixes: - Object file sizes and per-TU compile times are now baselined on the master sccache-warmup build (Build (arm_release_pr_cache_warmup)), which compiles master with the PR's exact cmake flags. The build profile hook now runs on the warmup job and uploads its object sizes and reduced compile trace; the sections degrade to a catch-up note until master accumulates warmup data. - Binary size comparison is restricted to clickhouse-stripped (the only binary whose size does not depend on debug info), with a threshold that absorbs the residual official-flag/PGO/BOLT difference. - The link time section is dropped: master links with debug symbols and PRs do not, so the wall times are incomparable by construction. - Per-function ThinLTO times are normalized by the median PR/master ratio, the same way the per-TU section absorbs machine-speed skew. Also addressed both AI-review Majors: - The producer hook is now fail-close: an artifact a profiled release build is required to produce (all three for amd_release/arm_release, object sizes for the warmup build) raises when missing or empty instead of being silently skipped, so a regressed prepare-time-trace.sh or missing nm can no longer turn into a false-green "no data" comparison. - The "no PR data" early return now updates the tagged PR comment instead of leaving a comparison for an older commit in place. Per review, each comparison aspect is reported as a separate sub-result so the aspects land as individual rows in cidb and in the CI report. Co-Authored-By: Claude Fable 5 <[email protected]>
|
Pushed 8576ccf, addressing the review findings and a comparability bug the check's own first report exposed. Why the first report showed −73% binary size on a CI-only PR: PR ThinLTO builds compile with
Both AI-review Majors:
@maxknv's nitpick: each comparison aspect is now emitted as its own sub-result in the job's Fixture tests updated (24 pass via The current CI reds are known flakies unrelated to this CI-only PR: |
… of both final binaries
Address the two AI-review Majors on the previous revision:
- The warmup build's time trace cannot be unconditionally required: when
every TU is an sccache hit it is legitimately empty, which made a broken
trace extractor indistinguishable from the all-cache-hit case ('binary_sizes.txt'
alone kept 'find_warmup_baseline' succeeding while the per-TU compile-time
section quietly lost its baseline). '_verify_trace_extraction' now uses the
ground truth: the compiler leaves one raw '-ftime-trace' file per TU it
actually ran on, so raw traces present + nothing extracted fails the hook
loudly.
- 'compare_opt_functions' no longer hard-wires 'programs/clickhouse': it now
diffs 'OptFunction' time keyed by (binary, function) over 'FINAL_BINARIES'
('clickhouse' and 'clickhouse-keeper'), with the same per-binary gating as
the symbol section - a binary is compared only when both sides have its
link trace, and a PR-side binary without a master baseline is called out
instead of silently dropped. 'SYMBOL_BINARIES' is renamed 'FINAL_BINARIES'
since it now feeds both sections.
The new keeper fixture also exposed a latent type error in the report
predicate: 'greatest(pr_dur, base_dur * skew)' mixes 'UInt64' and 'Float64',
which ClickHouse rejects with 'ILLEGAL_TYPE_OF_ARGUMENT'; 'pr_dur' is now cast
explicitly.
Tests: 5 new (3 hook, 2 fixture-backed via clickhouse local), 29 pass total.
#111164
|
Addressed both AI-review Majors in 0198243: Warmup trace fail-open: the warmup build's time trace cannot be unconditionally required — when every TU is an sccache hit it is legitimately empty — so the hook now disambiguates with the ground truth: the compiler leaves one raw ThinLTO section keeper blind spot: The new keeper fixture also exposed a latent type error in the report predicate — The two integration-test failures on the previous commit are unrelated flaky tests with tracked issues: |
…indow The per-TU compile-time comparison searches warmup traces over TU_BASE_DAYS = 14, but the section was gated on the warmup object-size baseline resolved with BASE_DAYS = 7. A warmup trace 8-14 days old therefore degraded the whole section to the catch-up note even though compare_compile_times would find real baselines. Now the section checks warmup trace availability itself, in its own window, and only degrades when no warmup ExecuteCompiler rows exist there at all; the BASE_DAYS warmup baseline keeps gating only the object-size section it belongs to. Adds the regression test the review asked for: a master commit whose only warmup data is 10 days old yields a real comparison, not the note. #111164
|
Addressed the remaining AI-review Major in f74e620: Added the requested regression test ( |
|
Addressed the two Majors from the latest AI review in 00c5a98, and merged master.
Two tests, both verified to fail before the fix: CI reds on 9e3ec08 were both unrelated to this CI-only change:
Still open for a human decision (unchanged): @maxknv's point about bypassing the Logs cluster in favour of a build-provided profile artifact + S3 reference. |
… the baseline The AI review found that `extend_master_shas` and `seed_master_shas` took `repos/.../commits?sha=...` verbatim as the master chain, but that listing interleaves merged PRs' second-parent commits: they pollute the baseline candidate set, burn the page budget, and their ancient commit dates can fire the TU_BASE_DAYS cutoff long before the first-parent history reaches it, silently truncating the baseline window into a false-green compile-time comparison. New `_walk_first_parent` reconstructs the chain by following `parents[0]` (the listing now carries parent shas), re-anchoring every fetch at the first first-parent sha not fetched yet so each fetch is guaranteed to advance the walk. The cutoff now fires on the chain's own tail; a listing that does not start with its own anchor fails close. `seed_master_shas` uses the same walk, capped at the ~100-commit kv-chain shape. `EXTEND_MAX_PAGES` raised to 60 since a mixed 100-commit page advances the chain by only ~25-50 commits. Both rewritten tests model the real API (ancient-dated merged-PR commits in every listing) and fail on the previous implementation. https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=111164&sha=1ddf512de11b00b3261684cb133ea3ab93ed2763&name_0=PR #111164 Co-Authored-By: Claude Fable 5 <[email protected]>
|
Addressed the AI-review Major in 1787559: the master-history extension now walks the true first-parent chain. Why the raw listing was wrong: The fix: new The two CI reds on 1ddf512 are unrelated to this CI-only PR:
@groeneai, investigate the failure: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=111164&sha=1ddf512de11b00b3261684cb133ea3ab93ed2763&name_0=PR&name_1=Stress%20test%20%28arm_asan_ubsan%29 (the Avro segfault above) and provide a fix in a separate PR. If the fix is already in progress, link it here. |
|
Investigated. Confirming your unrelatedness call: this is a pre-existing trunk bug in the Avro output format, reachable from a plain The aborting query, from the
Root cause:
That matters because the constructor never touches the encoder: The avro library guards this itself and is the clearest evidence the omission is the bug: Reaching The fix is one line in No fixing PR or tracking issue exists yet: searches for |
|
Root cause found, and it is not Avro-specific. Two symptoms, one defect. I have a deterministic reproducer and a verified fix, but the scope turns on a concurrency question I would rather you decide than guess. The defect. ClickHouse declares From there it splits:
Deterministic reproducer on unmodified master, no fuzzer needed: Segfault, with the same frames as the CI report. Varying one axis at a time: an empty target is clean, writing rows is clean of the segfault but produces the corrupt file, and every other format is clean, so the trigger is exactly non-empty-target plus zero-rows plus Avro. The fix I verified. Enforce the format's own contract in Measuring the blast radius across all 13 non-appendable formats through the fd route: 10 of them already produce unreadable output today, so for those this replaces silent corruption with a clear error. Where I need your call. Reading the failing job's The guard still closes both reported symptoms regardless of the interleaving, because it fires on an So either:
My preference is 1, because the crash and the silent corruption are the reported problems and the residual is narrower and no longer silent. But 2 is the complete fix for the concurrency defect, and it would make the documented "INSERT queries will wait each other" true for the first time. Tell me which you prefer and I will send that PR. |
|
@groeneai Go with option 1: send the nine-line guard now, and open a separate issue for the concurrent lost-update case. The reported problems are the segfault and the silent corruption, and your guard closes both deterministically. Option 2 means designing a path-scoped lock held from open through finalization, shared by Two asks for the guard PR:
Thanks for the thorough root-cause work — the four-routes-disagree analysis makes the right layer for the check obvious. |
|
Status on 1787559: the AI review verdict is now green ("No new blocker or major findings on the current PR head"), and CI is green except a single unrelated red — No code changes needed this round. Remaining before merge: the LogCluster-vs-artifact design question from @maxknv, and the final human merge. |
|
Option 1 confirmed. Before I send the guard, two corrections to my own measurements above, both of which change what the PR will say. The lost update I described does not exist. I claimed two concurrent writers into a freshly-emptied path give a file that reads back as one row. That was a misreading: 147 bytes is the size of a single writer's output, not the survivor of two. Re-measured, two concurrent same-path Avro inserts produce exactly twice the single-writer size (294 bytes; at 200k rows, 8 of 8 iterations gave 1186026 = 2 x 593013). No bytes are lost. The unreadable result is two concatenated headers, which is the with-rows corruption again, not a lost update. My staggered truncate runs were invalid too: one writer finishes in 0.16 to 0.80s, so 0.15 to 1.0s delays never overlapped, and a purely sequential control produces an identical file, which is just So I have no demonstrated lost-update defect, and I would rather not open an issue on a premise I just refuted. The accurate residual is the narrower one already acknowledged in the tree at The behavior change is wider than I reported. I said 10 of 13 formats are already unreadable with That answers your changelog question. The documented promise was never load-bearing on this route because it never appended, so I will use Bug Fix and spell the behavior change out in the description, naming all 6 affected formats rather than 2. Both asks are in the PR: the documentation qualification, edited in the embedded |
|
The guard is up: #112839 Both asks are in it. The documentation qualification is in the embedded Changelog category is I did not open the concurrency issue, since the premise I would have filed it on is the lost update I retracted. The accurate residual is the narrower one already acknowledged at |
# Conflicts: # ci/defs/job_configs.py
|
🕵 Merged The only conflict was in Verification after the merge: 60 tests pass ( The merge also pulls in #111689 (merged 2026-07-31), which fixes the only unrelated red on the previous head — AI review on the previous head was green ("No new blocker or major findings"). The remaining open item is still the design question from @maxknv: whether the check should read the profile from the Logs cluster (current implementation) or from a build-provided artifact referenced in S3/CIDB. |
|
📊 Cloud Performance Report ✅ AI verdict: This PR only adds CI machinery (a new 'Build profile diff' check plus build-profile upload tooling in prepare-time-trace.sh and the CI job configs); it does not touch the server's query-execution path. The single flagged query, ClickBench Q15, was deterministically suppressed as within master's variance band, and that verdict is consistent with the diff: a build/CI-only change cannot plausibly move a SELECT median, so the -12.3% reading is run-to-run noise. No real performance change here. The private and public diffs are identical, so this conclusion applies to both. clickbench🟢 No significant changes tpch_adapted_1_official🟢 No significant changes Debug info
|
|
🕵 Status on
|
…memory-pressure spikes
Since 2026-08-03, the `Post Hooks` step of `Build (arm_release)` fails on
75-86% of all runs, PRs and master alike: the telemetry INSERT into the
shared CI logs cluster is rejected with HTTP 500, Code 241
`MEMORY_LIMIT_EXCEEDED` ("User memory limit exceeded ... OvercommitTracker
decision: Query was selected to stop"), and `build_profile_hook.py` fails
closed. The wave started when ClickHouse#111164 began uploading reduced build
profiles for every PR build, multiplying the INSERT rate.
`LogCluster.do_query` made a single attempt (`retries=1`), while `select`
in the same file already retries 8 times with a growing backoff, its
comment documenting exactly these minutes-long Code 241 pressure spikes.
Retry the INSERT transport on the same schedule, and rewind a file-like
body before every attempt: requests consumes the stream on the first POST,
and re-sending the exhausted stream would run an INSERT with an empty body
- a success with the telemetry silently lost. 4xx rejections still fail
after the first attempt, and the fail-close `assert` stays.
Example report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=109496&sha=latest&name_0=PR&name_1=Build%20(arm_release)
Related: ClickHouse#113408
Co-Authored-By: Claude Fable 5 <[email protected]>
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
A new
Build profile diffcheck runs in every PR after theBuild (arm_release)job. It compares the PR's build profile against master using the CI logs database (build_time_trace,binary_sizes,binary_symbols) and posts (and keeps updated) a PR comment when there is a significant change.PR release builds and official master builds are compiled with different flags (PR ThinLTO builds strip debug symbols via
-DDISABLE_ALL_DEBUG_SYMBOLS=1and skip the official-build flag), so the check uses two master baselines:Build (arm_release_pr_cache_warmup)), which compiles master with the PR's exact flags: baseline for per-object.osizes and per-TU compile time of the translation units the PR recompiled, with per-entity drill-down (template instantiations, header parsing), normalized by the median PR/master ratio so machine-speed differences between runners do not produce false findings. The warmup job now runs the build profile hook to produce this data;Build (arm_release)): baseline for the artifacts that do not depend on debug info: the stripped binary size, per-symbol sizes of the final binaries, and per-function ThinLTO optimization time (also median-ratio normalized). Unstripped binary sizes and link wall time are not compared at all - they differ by construction.The reason PR builds had no data in these tables was an explicit
pr_number == 0gate inbuild_profile_hook.py- this PR removes it forarm_release. PR time traces are uploaded reduced (only the event kinds the diff consumes), because the bulk of a full trace is per-pass LLVM events of the ThinLTO link, and PR builds are far more frequent than master pushes. Additionally,prepare-time-trace.shnow collects symbols of the final linked binaries withnm: (Thin)LTO builds skipnmon.ofiles, sobinary_symbolspreviously had no rows at all foramd_release/arm_release. The symbol-size and warmup-baselined sections activate once master accumulates baseline data.The producer hook is fail-close: a profile artifact a release build is required to produce raises when missing or empty instead of being skipped, so a regressed producer cannot turn into a false-green "no data" comparison. Each comparison aspect is reported as a separate sub-result, so the aspects land as individual rows in cidb and in the CI report.
Validated locally against real data from the CI logs cluster, and with fixture-backed tests (
ci/tests/test_build_profile_diff_job.py,ci/tests/test_build_profile_hook.py) that drive the real query builders againstclickhouse local.The new job is
allow_failurewhile it stabilizes.Documentation entry for user-facing changes
🤖 Generated with Claude Code
Version info
26.8.1.644(included in26.8and later)