From 8b9788159ab40171b97db82395d9c4f0acdbc7f0 Mon Sep 17 00:00:00 2001 From: "Joshua D. Drake" Date: Thu, 22 Oct 2026 18:51:52 +0000 Subject: [PATCH] ci: the cluster-test job installs from the build job's apt cache The cluster-test job downloaded about 110 MB per run, most of it the LLVM toolchain that postgresql-server-dev-N depends on, and that download is what stalls. On 2026-10-22 its install step failed in most open PRs: all three 200-second attempts of #1740's retry stalled on azure.archive.ubuntu.com (for example job 120005288424, #1735, PG 18). The build jobs in the same runs fetched 0 B, because they install from a cached apt archive. The job now restores the newest archive under the build job's cache prefix, read-only, and installs with that directory as apt's archive cache. It derives no key and never saves, so there is no second copy of the build job's key derivation to go stale, which is why the job was left uncached before. apt still resolves every version and downloads whatever the archive lacks, so a miss or a stale archive falls back to the full download. Verified only by this PR's own run: the cluster jobs' logs must show the cache restored and a "Need to get" well below 110 MB. Guards: 804 passed. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/ci.yml | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1711fc575..cf3201a42 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -185,7 +185,7 @@ jobs: - name: fetch the release tags, for the fixture-blob comparisons run: git fetch --depth=1 origin '+refs/tags/v1.0-alpha*:refs/tags/v1.0-alpha*' - - name: Add the PGDG repository and install PostgreSQL ${{ matrix.pg }} with its headers + - name: Add the PGDG repository and refresh the package lists run: | set -euo pipefail sudo install -d /usr/share/postgresql-common/pgdg @@ -200,12 +200,34 @@ jobs: https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" \ | sudo tee /etc/apt/sources.list.d/pgdg.list >/dev/null .github/scripts/apt-retry.sh 100 3 update - .github/scripts/apt-retry.sh 200 3 install -y --no-install-recommends \ + + # SEEDED FROM THE BUILD JOB'S CACHE, READ-ONLY. This job downloaded ~110 MB per + # run, ~91 MB of it the LLVM toolchain postgresql-server-dev-N depends on, and that + # download is what stalls (#386). On 2026-10-22 all three 200-second attempts of + # #1740's retry stalled on azure.archive.ubuntu.com in most PRs' cluster jobs, while + # the build jobs in the same runs fetched 0 B from their cache. + # + # It derives no key of its own, so there is no second copy of the build job's key + # to go stale: it restores the newest archive under the build job's prefix and + # never saves. apt still resolves the versions, uses a deb from the archive only + # when it is the version it wants, and downloads the rest. A miss, or a stale + # archive, degrades to the full download this job made before. + - name: Restore the build job's PostgreSQL ${{ matrix.pg }} packages, if any + uses: actions/cache/restore@v4 + with: + path: ~/apt-archives + key: apt-pgdev-codecs-pg${{ matrix.pg }}-${{ runner.os }}-${{ runner.arch }}- + restore-keys: | + apt-pgdev-codecs-pg${{ matrix.pg }}-${{ runner.os }}-${{ runner.arch }}- + + - name: Install PostgreSQL ${{ matrix.pg }} with its headers + run: | + set -euo pipefail + mkdir -p "$HOME/apt-archives/partial" + .github/scripts/apt-retry.sh 200 3 \ + -o Dir::Cache::archives="$HOME/apt-archives" install -y --no-install-recommends \ postgresql-${{ matrix.pg }} postgresql-server-dev-${{ matrix.pg }} postgresql-${{ matrix.pg }}-partman postgresql-${{ matrix.pg }}-hll postgresql-${{ matrix.pg }}-tdigest \ liblz4-dev libzstd-dev zlib1g-dev - # NOT cached, deliberately. The suites job caches because it runs a matrix for - # an hour; a second copy of that cache-key derivation is a thing that goes - # stale silently, and this job is minutes long. # ASSERTED, not assumed. A missing pg_config would otherwise surface as a # confusing failure inside conftest's build rather than here.