Skip to content

Upgrade check: download previous-release packages from packages.clickhouse.com when GitHub cannot serve them - #130181

Merged
alexey-milovidov merged 1 commit into
ClickHouse:masterfrom
groeneai:groeneai/upgrade-check-deb-pool-fallback
Nov 8, 2026
Merged

alexey-milovidov merged 1 commit into
ClickHouse:masterfrom
groeneai:groeneai/upgrade-check-deb-pool-fallback

Conversation

@groeneai

@groeneai groeneai commented Nov 8, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #107916

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

...

Description

Upgrade check (amd_release) failed with Download script failed on 10 unrelated PRs between 2026-11-08 08:56Z and 10:30Z, during a GitHub incident ("Increase in timeouts for some unauthenticated users"):

DownloadException: Failed to obtain 1 required release package(s) for v26.10.2.103-stable: clickhouse-common-static_26.10.2.103_amd64.deb: Cannot download https://github.com/ClickHouse/ClickHouse/releases/download/v26.10.2.103-stable/clickhouse-common-static_26.10.2.103_amd64.deb, all 10 retries exceeded; last error: ...

Reports:
https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=130057&sha=6b36bb4ac06d2e2a9e2e87928cf1addd82920c4b&name_0=PR&name_1=Upgrade%20check%20%28amd_release%29
https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=119380&sha=cbfd9b603d71f0d644ae88fba562a23918a5e7ef&name_0=PR&name_1=Upgrade%20check%20%28amd_release%29

download_release_packages.py takes every deb from the GitHub release only. The 10-retry window from #107916 covers 6-10 minutes per file, and this outage lasted about 2 hours. The same files are in the ClickHouse Debian pool (https://packages.clickhouse.com/deb/pool/main/c/clickhouse/<asset name>); for v26.10.2.103 all six debs there have the same sha256 as the GitHub assets.

Each package now falls back to the pool when GitHub fails all its retries. After the first GitHub failure, the remaining packages try the pool first, so an outage costs one retry window per job instead of one per package. The loop stops at the first required package that neither source can serve. A healthy run makes exactly today's requests.

Validated locally against a stub that returns 504 for every GitHub URL: master fails with the CI message, and this change downloads all six debs from the real pool with matching digests. Also checked: healthy GitHub (pool never contacted), both sources down, mixed per-package failures, and pool reachability from the job's clickhouse/stress-test image. No test is committed, because this is test infrastructure.


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

Version info

  • Merged into: 26.11.1.1696-master (included in 26.11 and later)

…ase debs

`download_release_packages.py` downloaded every previous-release deb from
the GitHub release only. On 2026-11-08 github.com answered 504/502/read
timeouts for about two hours ("Increase in timeouts for some
unauthenticated users"), longer than the 10-retry window from ClickHouse#107916
(6-10 min per file), and `Upgrade check (amd_release)` failed with
`Download script failed` on 10 unrelated PRs.

The same files are published to the ClickHouse Debian pool
(https://packages.clickhouse.com/deb/pool/main/c/clickhouse/<asset name>);
for v26.10.2.103 all six amd64 debs there have the GitHub asset size and
sha256. A version that is not in the pool yet (about 30 minutes after a
release) answers a real 404, so the existing 404 fast-fail applies.

Each package now gets the pool as a second source. After GitHub has
failed one package, the rest of the run tries the pool first, so an
outage costs one retry window per job rather than one per package. Once
a required package cannot be obtained from either source the loop stops,
since the job fails anyway. GitHub stays the first source, so a healthy
run makes the same requests as before.

Validated locally with a stub that returns 504 for every GitHub URL:
master fails with the CI message; this change downloads all six debs from
the real pool with matching digests and contacts GitHub only for the
first package. No test is committed (test infrastructure).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@groeneai

groeneai commented Nov 8, 2026

Copy link
Copy Markdown
Collaborator Author
Internal second-model review: adjudication log (click to expand)

Pre-publication review by an independent model (engine: codex; 0 findings) plus my own cold review (1 nit).

# Sev Finding Verdict Evidence / action
1 💡 Pool reachability was checked from the job image, not from a CI runner; if a runner could not reach the pool, the pool-first order after a GitHub failure would add one retry window per remaining package AGREE, noted-not-blocking Only after GitHub already failed; bounded by the stop at the first unobtainable required package and the 2 h job timeout; CI docker builds already fetch from the same pool (ci/docker/test-base/Dockerfile)

Severity: ❌ blocker / ⚠️ major / 💡 nit.

Session id: cron:clickhouse-review-slot-8:20261108-165300

@groeneai

groeneai commented Nov 8, 2026

Copy link
Copy Markdown
Collaborator Author
Pre-PR validation gate (click to expand)
# Question Answer
a Deterministic repro? Yes. A local stub answering 504 for every GitHub asset URL makes master's download_release_packages.py raise Failed to obtain 4 required release package(s) ... all N retries exceeded; last error: 504, the CI message, on every run.
b Root cause explained? Every previous-release deb came from the GitHub release only; the 10-retry window (6-10 min per file) is shorter than the 2026-11-08 asset outage (~2 h), so a required package became unobtainable and the job failed.
c Fix matches root cause? Yes: a second, independent source (the ClickHouse Debian pool, same files), not more retries.
d Test intent preserved / new tests added? Test infrastructure: no committed test. Local harness evidence; the PR's own CI runs Upgrade check (amd_release) (the file is in its digest) on the healthy path.
e Both directions demonstrated? Yes: same stub, master fails, this change downloads all six debs from the real pool, sha256 equal to the GitHub digests, GitHub contacted only for the first package.
f Fix is general across code paths? All debs (required and optional) go through the same two-source loop; download_last_release reuses it. The release lookup and the previous-release clone are separate GitHub dependencies, covered by other PRs.
g Fix generalizes across inputs (params/datatypes/wrappers)? Healthy GitHub (pool never contacted), GitHub down, both down / pool 404, mixed per-package failures, optional-package failure, debug on and off; pool layout checked for six releases back to 25.8.
h Backward compatible? (maintainer-approved exception only) Yes: GitHub stays the first source, a healthy run makes the same requests. No settings.
i Invariants and contracts preserved? Files keep the GitHub asset name from either source; a partial file is removed before the next source; the 404 fast-fail and truncation checks apply to the pool; required vs optional semantics unchanged, except the loop now stops at the first required package neither source serves.

Session id: cron:clickhouse-impl-slot-6:20261108-164200

@groeneai

groeneai commented Nov 8, 2026

Copy link
Copy Markdown
Collaborator Author

cc @leshikus, could you review this and add the can be tested label so CI runs? When a previous-release deb fails all its retries on the GitHub release, the Upgrade check now takes the same file from packages.clickhouse.com/deb/pool and tries the pool first for the remaining packages, so a GitHub asset outage like the one on 2026-11-08 no longer fails the job.

@clickhouse-gh

clickhouse-gh Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [db0baf3]

Summary: ✅


AI Review

Summary

Adds the official Debian pool as a second source for previous-release packages when GitHub downloads fail, preferring the pool for subsequent packages after a GitHub failure. No actionable findings in the current diff. All 11 focused local checks passed, including failure handling and a live pool download verified against GitHub's published SHA-256.

Final Verdict

✅ Approve.

@clickhouse-gh clickhouse-gh Bot added pr-ci can be tested Allows running workflows for external contributors manual approve Manual approve required to run CI comp-ci-infrastructure CI/CD pipelines (GitHub Actions, CI scripts, runners). labels Nov 8, 2026
@alexey-milovidov alexey-milovidov self-assigned this Nov 8, 2026
@alexey-milovidov
alexey-milovidov added this pull request to the merge queue Nov 8, 2026
Merged via the queue into ClickHouse:master with commit c847f42 Nov 8, 2026
376 of 377 checks passed
@robot-clickhouse-ci-2 robot-clickhouse-ci-2 added the pr-synced-to-cloud The PR is synced to the cloud repo label Nov 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors comp-ci-infrastructure CI/CD pipelines (GitHub Actions, CI scripts, runners). manual approve Manual approve required to run CI 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