Skip to content

Fix the Upgrade check silently validating against a stale previous release - #115228

Merged
alexey-milovidov merged 7 commits into
ClickHouse:masterfrom
groeneai:fix-upgrade-check-stale-previous-release
Aug 21, 2026
Merged

alexey-milovidov merged 7 commits into
ClickHouse:masterfrom
groeneai:fix-upgrade-check-stale-previous-release

Conversation

@groeneai

@groeneai groeneai commented Aug 18, 2026 •

Copy link
Copy Markdown
Collaborator

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

The Upgrade check starts a previous release, then upgrades to the build under test.
tests/ci/get_previous_release_tag.py picks that baseline, and can silently pick one far too old.
On PR #114376 commit e1cb0dee5e9 it picked v25.1.4.53 for a 26.8.1.1 build; that old server
aborted on shutdown, reported as Received signal 6 unrelated to the PR. Two commits earlier it
resolved v26.7.3.19. 4 of 47 recent runs were affected.
Report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=114376&sha=e1cb0dee5e9bd972e9bbbdd8cd8d971ad1e39ee1&name_0=PR&name_1=Upgrade%20check%20%28amd_release%29

Root cause: when no candidate on a page could be used, an unbounded while not found: advanced to
page 2, 3 and answered from there. /releases returns entries roughly newest-created first, not in
version order, and each later page's newest release is older than the previous page's newest
(measured across all 9 pages), so page 1 holds the newest release overall. The only diagnostic was
logger.debug under basicConfig(level=INFO).

This resolves from the first page only. A candidate still needs an uploaded package, so a release
whose packages are still publishing keeps falling back to the previous patch release, now logged
at WARNING rather than DEBUG. Three cases now raise: a first page with no usable candidate, a page
shorter than the 100 requested, and an answer that is its page's oldest entry, which cannot show
that no newer release precedes it. upgrade_runner.sh turns those nonzero exits into a job failure.

No C++ change is needed: the abort is a use-after-free in 25.1, fixed in 2920d338ea4 (#81473,
released in v25.6.1.3206), so master and every active release branch carry the fix.

Tests were removed at review request. The Upgrade check's digest now lists both release helpers
upgrade_runner.sh runs, the resolver and download_release_packages.py; without them a change to
either leaves the job cache-skippable, the same failure mode fixed here.

Related: #112974 (hardens the API helper; edits the
same digest list, so whichever merges second rebases).


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

Version info

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

…lease

The Upgrade check starts a previous release and then upgrades to the build
under test. get_previous_release_tag.py picks that baseline, and it could
silently pick one many releases too old.

find_previous_release skipped any release below server_version whose metadata
did not yet list an uploaded clickhouse-common-static_*.deb, returning
(False, None). The caller's unbounded `while not found:` then advanced to the
next page. The /releases endpoint is ordered by created_at, not by version, so
later pages hold only older releases, and nothing re-checked that the answer
was the newest release below the version under test. The only diagnostic on
the skip path was a logger.debug under basicConfig(level=INFO), and the
resolver still exited 0 with a well-formed tag, so upgrade_runner.sh's
`[ $? -ne 0 ]` guard passed.

On PR ClickHouse#114376 commit e1cb0de this resolved v25.1.4.53 as the baseline for
a 26.8.1.1 build; that 25.1 server then aborted during shutdown on a
use-after-free that 2920d33 (ClickHouse#81473) already fixed, so the job reported
`Received signal 6` and `Cannot start clickhouse-server` for a reason
unrelated to the PR. Two commits earlier the same PR resolved v26.7.3.19
correctly with a byte-identical resolver, and 4 of 47 recent Upgrade-check
runs used a wrong baseline. Master and every active release branch already
carry the weak_ptr fix, so no C++ change is needed here.

Select the baseline by version alone and resolve from the first page or raise.
Page 1 holds 100 releases and its newest entry below 26.8.1.1 already equals
the maximum over all 700, so the walk was never needed on the healthy path; a
page-1 miss means the response was degraded, which is exactly when continuing
is wrong. A page cap was rejected because page 2 can supply a stale candidate
before any cap fires.

Removing the asset filter from selection changes one failure mode
deliberately: a partially published release that is genuinely the newest below
the build is now selected and fails at the download boundary with
`Download script failed`, instead of being skipped in favour of an older one.
Validation already fails closed there - download_packages raises for a
required prefix absent from the release metadata - so this trades a narrow
window for a loud, attributable failure instead of a silent wrong-baseline
run.

Adds ci/tests/test_get_previous_release_tag.py; the resolver had no tests.
Three of the six cases fail on the previous code, returning the exact stale
tags observed in CI.

Report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=114376&sha=e1cb0dee5e9bd972e9bbbdd8cd8d971ad1e39ee1&name_0=PR&name_1=Upgrade%20check%20%28amd_release%29
…s-release resolver

Review round 1 on the previous commit. Two corrections and three additions.

Restore the uploaded-package filter as a selection criterion. Dropping it did not
contribute to the fix and regressed the release publish window: for the 42.1 hours in
the last 6 months where the newest release below master had no uploaded
clickhouse-common-static deb, the resolver would select it and die at the download
boundary, turning 6063 Upgrade-check runs across 364 PRs from green into a hard
failure. The skip now logs at WARNING rather than DEBUG, which is what made the
original silent.

Enforce the precondition behind reading only page 1 instead of asserting it in a
comment. A page shorter than the 100 requested is a degraded response and raises.
The invariant holds with large margin: replaying every release event over all 824
releases gives 725 evaluation points and 0 mismatches, the correct baseline's
created_at rank is median 2 and max 11 of 100 slots, and a release takes a median
326 days to fall off page 1 against master's ~4-day minor cadence.

Guard the empty-releases branch so get_previous_release(None) raises the same
diagnostic as the versioned branch instead of a bare IndexError. The pre-existing
code did not raise at all on an unresolvable feed, it looped forever fetching pages.

Tests go from 6 cases to 11, covering the publish window, a truncated page 1, the
cross-page cutoff and the None contract. Two mutation arms confirm the cases that
pass on every honest arm still discriminate: reintroducing the page walk reddens the
incident case, and an unconditional page-2 union reddens the cutoff case.
Three follow-ups to the resolver fix, none of which changes its behaviour.

Add tests/ci/get_previous_release_tag.py to the CI Tests job cache digest.
The new guards live under ci/tests/, which the digest covers via "./ci", but
their subject does not: Utils.traverse_paths over the job's include_paths
yields 579 files including the test and excluding the resolver, so a change
to the resolver alone leaves the job cache-skippable and the guards never
run against it. Of 59 commits touching tests/ci/ since 2026-05-17, 37 do not
touch ci/ at all. Same one-line shape, and the same reason, as the entry for
build_download_helper.py. A new case asserts the path is in the digest that
praktika actually hashes rather than in the literal list, so it also fires if
the file is renamed or moved out of the digested tree.

Pin the bound behind reading a single page. The code enforces that page 1 was
complete; that only answers the question because a release stays on page 1
much longer than the interval in which a newer one appears. Measured on the
live feed over all 824 releases:

  max{v : v < V, v on page 1} == max{v : v < V, v in all releases}   2900/2900
  worst created_at rank of the correct baseline                      11 of 100
  page-1 window span (100 releases)      min 76 days, median 321, max 440
  minor-version bump gap                 median 28 days, max observed 73

Two cases cover the shape the real feed has and the boundary where every
eligible entry is more than a minor behind. Both compute the expected answer
from the page fixture instead of hard-coding it, so they state the selection
rule; both redden when the resolver is mutated to take the oldest eligible
release or to return releases[0] unconditionally.

The comment at the raise no longer asserts that conclusion as though it
followed from the created_at ordering, which is what makes version order and
creation order diverge in the first place.
Resolving from the first page only rests on that page holding the newest
release below the version under test. The code enforced that the page was
complete; that alone does not entail it reaches past the answer, and the
step between the two was only argued in a commit message.

Add the missing run-time check: if nothing on the page sorts below the
selected release, the page cannot show that no newer eligible release sits
off it, so raise instead of returning a baseline it cannot justify. No
extra request is needed.

Measured over the live feed, replaying every historical prefix of all 9
pages / 824 releases (725 evaluation points):

  page-1 answer vs whole-feed answer      0 divergences
  page-1 entries below the answer         min 1, p5 33, median 96, max 98
  points where the new check fires        0    (identical for all entries
                                                and for eligible ones only)
  server_version=None branch              min 98 below, 0 firings
  modern era (feed newest >= 2024-01-01)  307 points, min 14 below

So the check cannot fire on a healthy feed while still refusing the one
page shape that carries no evidence.

Two supporting corrections:

The endpoint's order was described as `created_at`. It is not: sorting all
824 entries by `created_at` descending does not reproduce the feed order
(164 inversions, 11 of them inside a single page-1 request, maximum
displacement 5 positions; `published_at` and `id` are no better). The
property the fix depends on is about versions across pages, and that does
hold exactly - the maximum version per page is strictly decreasing, 0
violations at the 8 boundaries, and page 1 holds the global maximum. The
wording now says what was measured.

The skip diagnostic was raised from DEBUG to WARNING in an earlier commit
because DEBUG under basicConfig(level=INFO) is what made the original
staleness silent, but nothing pinned the level. The publish-window case now
asserts the record, so reverting the level reddens it.

Also add the resolver to the cache digest of the Upgrade check, the job that
actually runs it. It digests upgrade_runner.sh, which symlinks and invokes
the resolver, but not the resolver itself, so is_affected_by was False for a
resolver-only change and for this pull request; the required
DEB_AMD_RELEASE producers are also unaffected, so nothing else marks the job
affected. Verified with praktika's own code: 12 digested files become 13 and
both queries become True.
…t page

The test module promised, unqualified, that the resolved baseline is the newest
release strictly below the version under test, while the suite also pins a case
returning a release that page 2 supersedes. Scope the promise to the page and
state why the page scope is sound and how it fails closed, so the contract the
suite advertises is the one it pins.

Also correct the cross-page ordering claim in the resolver comment. Read per
entry it is false: all 8 current page boundaries have an entry on a later page
with a higher version than the previous page's lowest, and the same holds for
714 of 724 historical feed prefixes (live: min(page 1) = v25.3.14.14-lts while
max(later pages) = v25.12.3.21-stable). The property the single-page rule
depends on is that each page's newest release is older than the previous
page's newest, which holds exactly: the per-page maxima 26.7.3.19, 25.12.3.21,
25.1.4.53, 24.1.1.2048, 22.12.3.5, 21.12.1.8816, 21.7.1.7029, 21.4.1.6345,
20.11.1.5003 are strictly decreasing over all 9 pages and 824 releases, 0
violations at the 8 boundaries and 0 over 724 historical prefixes, and page 1
holds the newest release overall.

No executable line changes. Suite unchanged at 16 passed, and the eight
mutation arms still redden the cases they target.
@groeneai

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

Five review rounds. All findings below are adjudicated against the code; the disagreements
carry measurements rather than argument.

# Finding Verdict
❌ The single page cannot be the global newest release below the build under test (raised in every round) Disagree, on measurement. Replayed the 824-release feed: for every version a master-based PR can produce, i.e. any version strictly above the newest release, the page-1 answer equals the whole-feed answer (26.8.1.1, 26.8.1.9999, 26.9.1.1, 27.1.1.1 all resolve v26.7.3.19). The highest version where the two diverge is 25.12.4.35, seven minors below the newest release 26.7.3.19, and the Upgrade check is wired only into the PR workflow with base_branches=[master], so that region is unreachable. Outside it the resolver raises rather than guessing.
⚠️ The two digests name the resolver but not its transitive imports (build_download_helper, git_helper, version_helper, ci_utils, env_helper, get_robot_token) Disagree on scope; the fact is correct. is_affected_by is indeed False for all six on both jobs. But no job in this repo digests any tests/ci file except the one added here: download_release_packages.py, symlinked into the same script one line away and invoked at :49, is in no digest at all. So this is a repo-wide convention gap rather than something this change introduces, and the PR's contract is that a change to the resolver cannot be cache-skipped, which the two entries and their per-job mutation arms establish. Adding the closure would also put six files, one of them as churn-prone as the resolver, into a two-hour job's invalidation surface. Noted, not blocking.
⚠️ The :31 [ $? -ne 0 ] guard is cited as the mechanism that reports a resolver failure (found in this review) Agree, text corrected. set -ex at :9 aborts on the :30 assignment before :31 is reached, so a nonzero resolver surfaces as a set -e abort and never prints that guard's message (verified with a faithful replica, plus a healthy-path control that does reach past it). Fail-closed either way, and the guard was already dead before this change, so no code change: the validation-gate comment now states the real mechanism.
💡 The digest guard computes traverse_paths(include_paths, []) while production passes digest_config.exclude_paths Disagree. Reproduced: injecting the resolver into exclude_paths leaves the assertion green while the real digest omits the file. Both jobs have empty exclusions today, so the guard agrees with production exactly; the gap needs a future edit to become live. Noted.
💡 The skip-diagnostic assertion accepts any level at or above WARNING rather than WARNING exactly Disagree. The contract is visibility, not a specific level: main() configures INFO, so the original DEBUG was invisible and both WARNING and ERROR are visible. A mutation arm confirms the case reddens when the call is reverted to DEBUG. Pinning the exact level would pin an implementation choice instead of the invariant.

Session id: cron:clickhouse-review-slot-8:20260817-235800

@groeneai

Copy link
Copy Markdown
Collaborator Author
Pre-PR validation gate (click to expand)
# Question Answer
a Deterministic repro? Yes. No network, no build: stub the pager with page 1 = a full page whose only candidates below 26.8.1.1 carry no asset metadata, and page 3 = [v25.1.4.53-stable] with a .deb, then call get_previous_release(26.8.1.1). The pre-fix resolver returns v25.1.4.53-stable after requesting pages [1,2,3], every run, which is the literal tag the failing job used.
b Root cause explained? Yes. find_previous_release skips a candidate below server_version whose metadata does not yet list an uploaded clickhouse-common-static_*.deb, returning (False, None); the caller's unbounded while not found: then advanced to the next page. /releases returns entries roughly newest-created first rather than in version order, and each later page's newest release is older than the previous page's newest (measured over all 9 pages / 824 releases: the max version per page is strictly decreasing, 0 violations at the 8 boundaries, and page 1 holds the newest release overall), so answering from a later page yields a stale baseline. Nothing re-checked that the answer was the newest release below the version under test. Only a logger.debug recorded the skip, under basicConfig(level=INFO), and the resolver still exited 0 with a well-formed tag.
c Fix matches root cause? Yes. The page walk is what makes a stale tag reachable, so resolution is now from the first page or a raise, and the two preconditions that make one page sufficient are enforced rather than assumed: a page shorter than the 100 requested is a degraded response, and an answer that is the oldest entry on its own page cannot evidence that no newer release precedes it. Both raise. Measured safe over 725 historical replay points: the selected answer always has at least 1 page-1 entry below it (median 96), so the second check never fires on a healthy feed. Three alternatives were rejected on measurement: a page cap (page 2 supplies a stale candidate before any cap fires), a page-union accumulation (union with early stop returns the identical stale answer), and dropping the uploaded-package filter (does not contribute to the fix and would turn the release publish window into a job-wide failure).
d Test intent preserved / new tests added? Nothing weakened. The resolver had zero tests (no reference to get_previous_release or find_previous_release anywhere under tests/ or ci/); this adds ci/tests/test_get_previous_release_tag.py with 16 cases covering the reported regression, the publish window and its WARNING diagnostic, the truncated page, the cross-page cutoff, the page-1 cadence bound at the boundary, the page-floor answer, the version-vs-feed-position property, the None contract, and the resolver's presence in the cache digest of both jobs that use it.
e Both directions demonstrated? Yes. Against the pre-fix tree 10 of the 16 cases fail; after the fix all 16 pass. The redness is substantive, not symbolic: the pre-fix arm returns the stale v25.1.4.53-stable for the reported-incident case and the assetless v26.7.3.19-stable for the publish-window case, and raises IndexError where a diagnostic is expected. Eight mutation arms confirm no case is vacuous: reintroducing the page walk reddens the incident case; an unconditional page-2 union reddens the cross-page cutoff; selecting the oldest eligible release, and returning releases[0] unconditionally, each redden both cadence cases; deleting the digest entry reddens that job's digest guard and only that one, per job; reverting the skip diagnostic to logger.debug reddens the publish-window case; and deleting or weakening the page-floor check to an always-false predicate each redden the floor case. Two fixtures were found vacuous in draft under a mutation arm and corrected, once in the previous round and once in this one; both remain red under the arm that caught them. --count=50 gives 800 passed, zero flakes.
f Fix is general across code paths? Yes. Fixed at the resolution rule, so both callers are covered by the one change: upgrade_runner.sh:30 and download_release_packages.py:89. CLICKHOUSE_TAGS_URL has no other consumer, and the sibling paged-GitHub loops differ in kind: changelog.py:170 is a rate-limit retry, github_helper.py:299 exhausts all pages into a dict with no first-match-wins, check_ci.py:926 is an interactive prompt.
g Fix generalizes across inputs (params/datatypes/wrappers)? Yes, an 8-case boundary matrix was run against the pre-PR tree, the previous revision and this one: empty page, a single older entry, all entries equal to server_version, no recognized tag, junk mixed with a valid tag, and each of those with server_version=None (the download_last_release contract). Every unresolvable shape now raises ReleaseNotFoundException with the counts and the newest/oldest tag on the page. Two shapes that previously had no diagnostic are now covered: the pre-PR resolver loops forever fetching empty pages (confirmed at 500 fetches), and server_version=None on an empty page raised a bare IndexError.
h Backward compatible? Yes, nothing user-visible: no settings, no serialization, no SettingsChangesHistory.cpp. Behaviour on every healthy input is unchanged, verified against the live API (26.8.1.1 and the None contract both resolve v26.7.3.19-stable, page 1 returns exactly 100 entries). The release publish window keeps its existing behaviour of falling back to the previous patch release, now logged at WARNING instead of DEBUG.
i Invariants and contracts preserved? Yes. The invariant is that the resolved baseline is the newest release on the first page strictly below the version under test, or resolution fails loudly; the page scope is sound because a complete page spans far more releases than are published between two minor bumps, and the resolver raises rather than answering when the page cannot show that it reaches past its own answer. Package validation is unchanged and still layered: an unusable candidate is skipped here, and download_packages independently raises for a required prefix absent from release metadata, which upgrade_runner.sh:49-56 turns into Download script failed and exit 1. Verified the resolver cannot fail open, with a negative control at the shell boundary: the degraded, truncated and page-floor paths exit 1 with empty stdout, while the healthy path exits 0 printing the correct tag. The job fails either way, though not through the [ $? -ne 0 ] guard at upgrade_runner.sh:31: set -ex at :9 aborts the script on the :30 assignment before that guard is reached, so a nonzero resolver surfaces as a set -e abort. That guard is pre-existing dead code, and this PR does not change the script. The guards also stay live: the resolver is now in the cache digest of both jobs that depend on it, so neither can reuse a cached success across a change to it.

@clickhouse-gh

clickhouse-gh Bot commented Aug 18, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [a482dcf]

Summary: ✅


AI Review

Summary

This PR fixes the reported stale-baseline incident by stopping the previous-release resolver from walking into older GitHub release pages, and it correctly adds the two release-helper entrypoints that upgrade_runner.sh executes to the Upgrade job digest. The source fix itself looks sound, but one cache-invalidation gap remains: behavior-changing edits in the shared helper modules those entrypoints import can still be cached out of both the end-to-end Upgrade check and the focused Python tests for this path.

Findings

⚠️ Majors

  • [dismissed by author -- https://github.com/Fix the Upgrade check silently validating against a stale previous release #115228#issuecomment-5321983485] [ci/defs/job_configs.py:1102] The digest now names get_previous_release_tag.py and download_release_packages.py, but it still does not cover the shared modules that implement their runtime behavior. On the current head, JobConfigs.upgrade_test_jobs[0].is_affected_by(["tests/ci/build_download_helper.py"]), ...(["tests/ci/version_helper.py"]), and ...(["tests/ci/git_helper.py"]) all return False; JobConfigs.ci_tests.is_affected_by(...) is also False for the same paths. That means a change to download semantics or version/tag parsing can still skip both the Upgrade check and the unit tests that are supposed to exercise these scripts, recreating the same "release-helper change was never exercised" failure mode one import hop lower.
    Suggested fix: extend the digest coverage to the transitive runtime dependencies of these entrypoints, or move the shared helpers under an already-digested path so behavior-changing edits cannot be cached out.
Final Verdict

Changes requested: the stale-baseline fix is good, but the release-helper cache coverage is still incomplete and can still skip the very upgrade/download code path this PR is trying to harden.

@groeneai

Copy link
Copy Markdown
Collaborator Author

cc @maxknv, could you review this? The Upgrade check's baseline resolver walked to later pages of the GitHub releases feed when the first page had no usable candidate, and those pages hold only older releases, so it silently validated a 26.8.1.1 build against v25.1.4.53; it now resolves from the first page or raises.

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Aug 18, 2026
@PedroTadim PedroTadim self-assigned this Aug 18, 2026
@PedroTadim PedroTadim added the can be tested Allows running workflows for external contributors label Aug 18, 2026
@clickhouse-gh clickhouse-gh Bot added the manual approve Manual approve required to run CI label Aug 18, 2026
@@ -0,0 +1,423 @@
"""
Tests for `get_previous_release_tag`, the resolver that picks the baseline the
Upgrade check installs and starts before upgrading to the build under test.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@groeneai remove both tests in this PR

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Done in 6f1bd7d - the whole module is gone. I read "both tests" as the test file rather than two of its cases, since they are all in the one file this PR adds; say the word if you meant something narrower.

I also reverted the CI Tests cache digest entry, which only existed so those cases would run against the resolver, so that block is byte-identical to master again. I kept the Upgrade check's digest entry: upgrade_runner.sh symlinks and runs the resolver, so without it a resolver-only change leaves that job cache-skippable, which is the signal loss this PR fixes.

Source fix unchanged. The PR is now source-only: 60 insertions, 29 deletions across the resolver and that one digest line. I dropped the paragraph in the description that claimed new tests.

while not found:
response = get_gh_api(
CLICKHOUSE_TAGS_URL, params={"page": page, "per_page": 100}, timeout=10
response = get_gh_api(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This shortcut is only correct for the current master-style inputs, but the helper no longer enforces that precondition. With the live releases feed today, get_previous_release(25.12.4.35) returns v25.11.9.34-stable from page 1 even though v25.12.3.21-stable exists on page 2 and is the true newest release below the target. That means older but still valid version inputs now silently resolve to the wrong baseline instead of failing closed. Please either keep paging until you can prove you've crossed below the answer for these inputs, or explicitly raise when server_version is in a range where the one-page assumption is not guaranteed.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The citation reproduces but the consequence does not: this is pre-existing behaviour, not something this PR introduces.

Same live feed, same input, both arms instrumented for the pages they request:

PRE-FIX  (base d59f2be34ed3): 25.12.4.35 -> 25.11.9.34, pages requested=[1]
POST-FIX (this PR):           25.12.4.35 -> 25.11.9.34, pages requested=[1]

Identical. The old page walk stopped at the first page holding any eligible candidate, so it never compared across pages either. "Now silently resolves to the wrong baseline instead of failing closed" describes no change here.

The input is also unreachable in the only workflow that runs this job. server_version is the version of the .deb under test (upgrade_runner.sh:30), and Upgrade check is instantiated only at ci/workflows/pull_request.py:181 with base_branches=[BASE_BRANCH], BASE_BRANCH = "master" (ci/defs/defs.py:46). Master is 26.8.1.1 against a newest release of 26.7.3.19, so the build under test is always above every release; 25.12.4.35 is seven minors below it. In the reachable range page 1 and the whole feed agree (26.8.1.1 -> 26.7.3.19 on both arms).

On the two suggested remedies: "keep paging" is the unbounded while not found: walk this PR removes, and that walk is what produced the reported incident (v25.1.4.53 picked for a 26.8.1.1 build). An explicit raise for that range would fire on an input the workflow cannot produce.

No source change.

@clickhouse-gh

clickhouse-gh Bot commented Aug 18, 2026 •

Copy link
Copy Markdown
Contributor

Build profile diff (arm_release)

Comparing a482dcffb with master 2bb9dae14 (stripped binary size, per-symbol sizes and ThinLTO time; object sizes against the warmup build of c545616f6; compile times per translation unit against the most recent warmup build that recompiled it).

✅ No significant changes.

Binary sizes
Binary Master PR Δ
programs/clickhouse-stripped 702.05 MiB 699.03 MiB -3.03 MiB (-0.43%)

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.

Compile time of recompiled translation units

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

Job report

@PedroTadim asked for the tests in this PR to be removed. Dropping
ci/tests/test_get_previous_release_tag.py and, with it, the ci_tests cache
digest entry that existed only so those cases would run against the resolver;
that block is now byte-identical to master again.

The Upgrade check digest entry stays: upgrade_runner.sh symlinks and runs the
resolver in production, so without it a resolver-only change leaves that job
cache-skippable. That is the same signal loss this PR fixes, and it is
independent of the tests.

The source fix is unchanged.
Comment thread ci/defs/job_configs.py Resolved
upgrade_runner.sh symlinks and executes both tests/ci/get_previous_release_tag.py
and tests/ci/download_release_packages.py, but only the resolver was in the job's
digest inputs. A change to the required package prefixes, to the download failure
handling, or to download_last_release could therefore be cached out and never
rerun the Upgrade check, which is the same silently-skipped-release-helper failure
mode this PR exists to fix.

Measured on this branch before the change:

  is_affected_by(["./tests/ci/get_previous_release_tag.py"])  = True
  is_affected_by(["./tests/ci/download_release_packages.py"]) = False

and after it both return True, while an unrelated path
("./src/Disks/DiskLocal.h") still returns False.

Reported by clickhouse-gh[bot] on ClickHouse#115228.
@PedroTadim PedroTadim removed their assignment Aug 18, 2026
@groeneai groeneai added the groeneai-origin-request PR origin: a maintainer pinged or directed groeneai label Aug 19, 2026

@alexey-milovidov alexey-milovidov left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Reasonable.

@alexey-milovidov alexey-milovidov self-assigned this Aug 21, 2026
@alexey-milovidov
alexey-milovidov added this pull request to the merge queue Aug 21, 2026
Merged via the queue into ClickHouse:master with commit 1ec84ba Aug 21, 2026
183 checks passed
@robot-clickhouse-ci-1 robot-clickhouse-ci-1 added the pr-synced-to-cloud The PR is synced to the cloud repo label Aug 21, 2026
yariks5s pushed a commit to ylw510/ClickHouse that referenced this pull request Oct 23, 2026
`get_previous_release_tag` reads page 1 of the GitHub releases list and,
since ClickHouse#115228, refuses a page shorter than the 100 releases it asks for,
because choosing from or walking past a degraded page gave stale
baselines. It refused after a single request, though. GitHub sometimes
answers that request with HTTP 200 and `[]`, which `get_gh_api` returns
as a success (it retries only on HTTP errors), so one degraded answer
killed the job: on 2026-10-22, 14:58-15:32 UTC, `Upgrade check
(amd_release)` ended after about a minute with `Unknown job error` on 5
unrelated PRs. Probing the same URL returned `[]` on 4 of 19 requests,
each followed by a full page within 10-22 s; answers carry
`cache-control: s-maxage=60`, and one empty answer came from the edge
cache.

Retry a short first page up to 4 times, 60 s apart, so the cached answer
has expired before the next request, then raise the same
`ReleaseNotFoundException` as before. A full page still costs one request
and no wait. HTTP 5xx on the same request is left to ClickHouse#112974.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
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 groeneai-origin-request PR origin: a maintainer pinged or directed groeneai 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.

4 participants