Skip to content

Stop installing the debug symbols in every Install packages test - #112751

Merged
alexey-milovidov merged 2 commits into
masterfrom
install-packages-skip-redundant-debug-symbols
Aug 1, 2026
Merged

alexey-milovidov merged 2 commits into
masterfrom
install-packages-skip-redundant-debug-symbols

Conversation

@alexey-milovidov

@alexey-milovidov alexey-milovidov commented Jul 31, 2026 •

Copy link
Copy Markdown
Member

The Install packages job runs for about 890 seconds against a 900 seconds timeout and times out several times a week (WARNING: Job timed out: [Install packages (amd_release)], timeout [900]). More than half of that time goes into the debug symbols packages, which no test in the job uses — the tests start a server, an init.d script or a keeper and ask for a version.

They are picked up by accident. clickhouse-{server,client,common}*deb also matches clickhouse-common-static-dbg (3.4 GiB unpacked) and clickhouse-keeper*deb also matches clickhouse-keeper-dbg (2.3 GiB), so the twelve tests install them ten times over.

Measured on 3bb7f633cfc4794a68bd724a8060b472fd6ec5d5 (amd), per test, total vs. the part spent on the debug symbols:

test total debug symbols
Install server deb 75s 39s
Run server init.d (proxy to systemd) 72s 48s
Run server init.d 75s 45s
Install keeper deb 51s 29s
Install server rpm 92s ~83% of an 84s transaction
Install keeper rpm 61s ~83% of a 44s transaction
Install server tgz (deb image) 96s 72s = 35s untar + 37s copy
Install keeper tgz (deb image) 56s 41s
Install server tgz (rpm image) 98s 74s = 34s untar + 40s copy
Install keeper tgz (rpm image) 68s 46s

The tgz tests pay twice because doinst.sh copies the unpacked tree instead of moving it.

This takes the debug symbols out of the four tests that duplicate coverage:

  • Run server init.d and Run server init.d (proxy to systemd) install exactly the same packages as Install server deb and differ from it only in the way the server is started;
  • the tgz tests run over the same tarballs in the deb and in the rpm image, and the second run exists to check that doinst.sh works outside Debian.

Every debug symbols package is still installed once per package format, so nothing is left untested. This saves 213 seconds, bringing the job to around 675 seconds.

Verified that the new globs select exactly the intended files against the real package names, and that both tgz variants install correctly end to end in a container. Also confirmed from the deb control files that nothing depends on a -dbg package: clickhouse-server depends only on clickhouse-common-static.

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):

...

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

Related: #112687

CI report the investigation started from: https://s3.amazonaws.com/clickhouse-test-reports/json.html?REF=master&sha=3bb7f633cfc4794a68bd724a8060b472fd6ec5d5&name_0=MasterCI&name_1=Install%20packages%20%28amd_release%29

Version info

  • Merged into: 26.8.1.588 (included in 26.8 and later)

The `Install packages` job runs for about 890 seconds against a 900 seconds
timeout and times out several times a week. More than half of that time goes into
the debug symbols packages, which no test in the job uses - they only start a
server, an init.d script or a keeper and ask for a version.

The packages are picked up by accident: `clickhouse-{server,client,common}*deb`
also matches `clickhouse-common-static-dbg` (3.4 GiB unpacked) and
`clickhouse-keeper*deb` also matches `clickhouse-keeper-dbg` (2.3 GiB), so the
twelve tests install them ten times over. Measured on
3bb7f63, that is 39 seconds of the 75 seconds of
`Install server deb`, 72 of 96 in `Install server tgz` - the tgz packages pay
twice, because `doinst.sh` copies the unpacked tree instead of moving it - and so
on for the rest.

Take the debug symbols out of the four tests that duplicate coverage:
`Run server init.d` and its `proxy to systemd` variant install exactly the same
packages as `Install server deb`, and the tgz tests run over the same tarballs in
the deb and in the rpm image. Every debug symbols package is still installed once
per package format, so nothing is left untested. This saves 213 seconds.

Related: #112687

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@clickhouse-gh

clickhouse-gh Bot commented Jul 31, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [a38ed75]

Summary: ✅


AI Review

Summary

This PR narrows the package globs in ci/jobs/install_check.py so the Install packages job stops reinstalling the -dbg packages in the redundant deb init.d checks and in the second tgz image run. I checked the current diff, the release artifact naming contract, the generated tgz installer logic, and the existing PR discussion, and I did not find a correctness or coverage regression that warrants an inline review comment.

Final Verdict

✅ No blocking or major findings.

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Jul 31, 2026
…ip-redundant-debug-symbols

# Conflicts:
#	ci/jobs/install_check.py

@alexey-milovidov alexey-milovidov left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok.

@alexey-milovidov
alexey-milovidov added this pull request to the merge queue Aug 1, 2026
Merged via the queue into master with commit 5df0f42 Aug 1, 2026
178 checks passed
@alexey-milovidov
alexey-milovidov deleted the install-packages-skip-redundant-debug-symbols branch August 1, 2026 14:25
@robot-ch-test-poll robot-ch-test-poll added the pr-synced-to-cloud The PR is synced to the cloud repo label Aug 1, 2026
alexey-milovidov pushed a commit to Onyx2406/ClickHouse that referenced this pull request Aug 7, 2026
Install packages (amd_release) failed on master sha 7039251 with

  dpkg: error processing archive clickhouse-common-static-dbg_26.8.1.673_amd64.deb
   cannot copy extracted data for './usr/lib/debug/usr/bin/clickhouse.debug' to
   '/usr/lib/debug/usr/bin/clickhouse.debug.dpkg-new': failed to write
   (No space left on device)

The runner arrived at 55G used / 3.2G available / 95% full, while apt announces
"After this operation, 4413 MB of additional disk space will be used". The first
of 18 substeps therefore could not succeed, and the outcome was settled before
the job wrote a byte.

The job's own footprint is not the variable. It is constant at +3-4 GiB across
green and failing runs alike, which is why the three merged fixes in this area
(ClickHouse#111960 synchronous per-substep docker rm, ClickHouse#112751 stop installing dbg in most
tests, ClickHouse#113032 binary tests last plus a non-interactive docker system prune) did
not close it: all three shrink or reorder that constant footprint. All three are
ancestors of this failing build.

What discriminates green from red is the state the runner starts in:

  FAIL  7039251 amd  i-0969e2fde61d860b0  55G used / 3.2G avail / 95%  1/18 fail
  GREEN 2251e69 amd  i-0b4dbf6ffb28c656e  24G used /  34G avail / 42%  18/18 ok
  GREEN 2251e69 arm  i-08f529e20e7f4090e  18G used /  41G avail / 31%  18/18 ok

CIDB shows the same start-state exhaustion in 15 Install packages runs over the
last 20 days, 7 on master and 8 on release branches (26.5 four, 26.6 two, 26.3
and 26.4 one each). Only 2 of the 15 carry this dpkg signature; the other 13
raise earlier, in the tgz substep, where docker run cannot allocate and exits
125, in 9 of the 13 while creating a containerd overlayfs snapshot dir and in
the other 4 at another daemon-side path under /var/lib/docker or /tmp. All 13
are exit 125 and all 13 are ENOSPC in the same substep, so the start-state class
is the same regardless of which allocation happens to be the one that fails.
Those 13 abort the job before any test row exists, so CIDB records them with an
empty test_name, which is why a breadth query keyed on the test name undercounts
the class. One of them, a61e6f1 on 26.3, ran on this same instance
i-0969e2fde61d860b0 54 minutes earlier, also one job after a Docker keeper image
run: same box, same residue, a different substep happening to be the one that
ran out.

Install packages runs on the style-checker pool, which also hosts the multi-arch
docker image builds. install_check.py pulls exactly two images, and the green
runner's post-hook deleted exactly those two; the failing runner's post-hook
deleted eight tags, six of which this job never pulled: five
clickhouse/clickhouse-keeper:head-* tags, including arm64 ones on an amd runner,
plus a stale install-deb-test tag.

That residue has an identified producer. Joining on the CIDB instance_id, the
job immediately before the failure on the same box is Docker keeper image for
BackportPR ClickHouse#112982 (sha 934bc90, branch backport/25.8/108977), 14:33:46 to
14:38:30, with the install job starting at 14:45:21 and nothing in between. It
ran in the non-push flavour (EVENT_TYPE='pull_request'), so its six builds used
--output=type=docker and tagged every arch in the local image store, whereas a
master-flavour run pushes by digest and creates no local arch tag. Its own
post-hook removed exactly one of those six tags; the five survivors are the same
five keeper tags the install job deleted 15 minutes later, and two of the image
IDs it reported as "unable to delete (must be forced) - image is referenced in
multiple repositories" before exiting 123 are among the IDs the install job then
removed.

The reason it left them is a hook version skew. At the producer's sha the cleanup
hook has no forced pass at all, only builder prune, container prune and an
unforced docker rmi. The forced pass over clickhouse/clickhouse- and
clickhouse/install- images was added by ba64179, which is an ancestor of
this failing master build but is not on the 25.8 line. Multi-arch head-* images
share layers and so are referenced in multiple repositories, which is exactly
what an unforced rmi refuses to remove.

docker_clean_up_hook was registered only as post_hooks, so on the consumer side
it frees that residue after the failure.

Register the same hook as a pre_hooks entry as well, on both Install packages
configs. That covers 4 parametrized jobs (amd and arm) across the PR, BackportPR,
MasterCI and ReleaseBranchCI workflows, 8 job objects in total, each verified
pre=1 post=1. Fixing the producer instead would mean backporting the newer hook to
every release and backport branch still in flight, whereas defending at the
consumer covers residue from any producer running any hook version. Nothing is
narrowed or skipped: no glob, no package, no test, no assertion. Re-pulling the
two install images costs seconds against a 900 s timeout: the measured deb+rpm
totals in the three captured logs are 4 s, 12 s and 9 s.

The reclaim is best-effort, deliberately. The hook ignores every Shell.check
return and returns True; runner.py builds the pre-hook result but never feeds it
into the flag gating the run, and appends it after the parent status was already
computed. Adding strict=True was rejected: the hook is shared by four other
post_hooks registrations, so failing closed would newly break unrelated checks on
a cleanup hiccup, and gating a run on pre-hooks is a praktika-wide contract
change. If the reclaim frees nothing the outcome is today's, never worse.

Note that pre_hooks is not among the fields dropped from the job digest, so the
config digest changes and the first run after merge is uncached instead of served
from cache. That is intended: a result cached without the pre-hook should not
satisfy the new config.

There is no local reproducer, since the trigger is another job's leftover disk
state on a shared runner, and a green run on this change proves nothing because
it requires drawing a dirty runner. Validation is mechanical: pre_hooks verified
non-empty on all four jobs, praktika yaml regenerating no workflow YAML, and the
hook exiting 0 both on a clean store and on one seeded with the observed residue,
which it removes while leaving unrelated images untouched.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-ci 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.

3 participants