Skip to content

Upgrade check: let the previous release re-attach the projections with positional arguments its tests create - #128105

Merged
PedroTadim merged 2 commits into
ClickHouse:masterfrom
groeneai:upgrade-check-previous-release-positional-projections
Nov 23, 2026
Merged

PedroTadim merged 2 commits into
ClickHouse:masterfrom
groeneai:upgrade-check-previous-release-positional-projections

Conversation

@groeneai

@groeneai groeneai commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #104430
Related: #124532

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) reds on Error message in clickhouse-server.log on unrelated PRs. Two leftovers of the previous release's tests cause it; --fake-drop keeps their tables in the shared stress databases.

  1. Report: the upgraded server retries a mutation of 05259_mutation_of_part_without_table_columns, although the pre-upgrade kill step reported none. 05182_projection_positional_arguments_with_analyzer creates a projection with GROUP BY 1 under SET enable_positional_arguments_for_projections = 1. A table is loaded with the global context (Tables with positional-argument projections cannot be attached when enable_positional_arguments_for_projections=false because ATTACH uses global context, ignoring session settings #104430), i.e. the default profile, where only the upgraded server has the setting (compatibility.xml). So on the previous release 01160_table_dependencies' ATTACH DATABASE fails with NOT_AN_AGGREGATE and leaves the database detached, out of the kill step's sight.
  2. Report: 04627_lwd_rebuild_normal_projection_no_where creates PROJECTION p (SELECT count() GROUP BY 0) without the setting, so 0 is a constant key. The upgraded server reads it as a position and skips the projection (Positional argument number 0 is out of bounds).

Change: write the setting into a users.d file before the previous release starts. The second configure keeps users.d, so the upgraded server reads the same file and the line in compatibility.xml is removed. Both servers then load projections with the same setting, and the previous release already rejects the CREATE of case 2. My open #124532 (restart the previous release before the kill step) would also bring the database of case 1 back for the kill step.

Validation (local rig: 26.10.2.103 tgz as the previous release, master build as the upgraded one, Keeper, the script's own kill/drain fragment, the tests' own statements): case 1 reproduces in 3/3 runs without the change; with it 4/4 runs keep the database attached, the kill step kills the mutation, and the upgraded server logs 0 <Error> lines. Case 2 follows from the v26.10.8.34 source (an inline projection is analyzed with the global context); I did not run it.


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

Version info

  • Merged into: 26.12.1.314-master (included in 26.12 and later)

…sitional arguments

Tests of the previous release (03758, 05182, 05318) define a projection with
`GROUP BY 1` under `SET enable_positional_arguments_for_projections = 1`, and
`--fake-drop` keeps the table in the shared stress database. A table is loaded
with the global context (ClickHouse#104430), so the setting only counts when it is in the
default profile, and the previous-release server does not have it there: an
`ATTACH DATABASE` (01160_table_dependencies does detach/attach x10) fails with
NOT_AN_AGGREGATE and leaves the whole database detached (a server startup
instead keeps the table and skips the projection with an <Error>). The
pre-upgrade kill step only sees attached databases, so a broken mutation of
that database (here the replicated arm of
05259_mutation_of_part_without_table_columns, cut before its KILL MUTATION)
survives, the upgraded server re-attaches the database (its profile has the
setting via compatibility.xml) and retries the mutation for the whole
post-upgrade window, which the <Error> scan reports.

Write the setting into a users.d file before the previous release starts. The
second `configure` keeps users.d (install.sh only recreates config.d), so the
upgraded server reads the same file and the line in compatibility.xml is
redundant; remove it.

Failing run: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=108078&sha=bf6f312dbb8f2178fd75d1e683ad5a2778dc0296&name_0=PR&name_1=Upgrade%20check%20%28amd_release%29

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

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 an own cold review (2 PR-description nits, both applied before the gate ran).

# Sev Finding Verdict Evidence / action
1 💡 The description did not mention #124532, which targets the same detached-database class AGREE, fixed in the description A previous-release startup keeps such a table and skips only its projection, so the restart of #124532 would also expose the mutation; one sentence added
2 💡 The Related link sat inside the template's HTML comment and was invisible AGREE, fixed in the description Link lines moved below the comment

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

Session id: cron:clickhouse-review-slot-8:20261029-042900

@groeneai

Copy link
Copy Markdown
Collaborator Author
Pre-PR validation gate (click to expand)
# Question Answer
a Deterministic repro? Yes. A local rig (26.10.2.103 as the previous release, a master build as the upgraded one, embedded Keeper) replays the tests' own statements: 05182's projection, 05259's replicated arm up to its failing MODIFY COLUMN, 01160's detach/attach database, then the script's own kill/drain fragment and the upgrade. 3/3 runs reproduce the CI signature.
b Root cause explained? The previous-release profile lacks enable_positional_arguments_for_projections, and a table is loaded with the global context (#104430), so 01160's ATTACH DATABASE fails with NOT_AN_AGGREGATE on 05182's GROUP BY 1 projection and the shared database stays detached. The kill step only sees attached databases (false OK), and the upgraded server, whose profile has the setting, re-attaches it and resumes 05259's mutation.
c Fix matches root cause? Yes. The previous release gets the setting in its profile, so the database stays attached and the existing kill step reaches the mutation. No allowlist entry.
d Test intent preserved / new tests added? No test added: test-infrastructure change, validated locally (rig evidence).
e Both directions demonstrated? Without the change 3/3: ATTACH fails, kill step reports OK with nothing listed, 30 error lines in 60 s after the upgrade. With it 4/4: ATTACH succeeds, mutation 0000000001 is listed and killed, MUTATE_PART drains 1 -> 0, 0 <Error> lines after the upgrade.
f Fix is general across code paths? One profile setting covers every loader of such a projection, measured both ways: ATTACH DATABASE, ATTACH TABLE, and a server startup (without the setting a startup keeps the table but skips the projection with an <Error>). All three previous-release tests that create such projections are covered.
g Fix generalizes across inputs (params/datatypes/wrappers)? N/A for types (CI script). The previous release (26.10.2.103) accepts the profile setting; it exists since 25.12.
h Backward compatible? (maintainer-approved exception only) Yes. CI script only; no setting default changes.
i Invariants and contracts preserved? The upgraded server still reads the setting as 1 (now from the users.d file, which the second configure keeps) and compatibility is unchanged; the kill/drain fragment is unchanged.

Session id: cron:clickhouse-impl-slot-6:20261029-040200

@groeneai

Copy link
Copy Markdown
Collaborator Author

cc @leshikus, could you review this and add the can be tested label so CI runs? The previous release in the Upgrade check lacked enable_positional_arguments_for_projections in its profile, so an ATTACH DATABASE of a stress database holding a GROUP BY 1 projection failed and left it detached, hiding its unfinished mutation from the kill step; the setting now goes into a users.d file that both servers read.

@clickhouse-gh

clickhouse-gh Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [816b3ba]

Summary: ✅


AI Review

Summary

Reviewed #128105 at 816b3ba47332a778d36d31bb1a678d99b95663fc. The change enables enable_positional_arguments_for_projections in the default profile before starting the previous release and preserves it for the upgraded server. This addresses the reported projection-loading failures without broadening the log allowlist. No actionable findings. The author's recorded before/after reproduction provides appropriate evidence for this CI-only configuration change.

Missing context / blind spots
  • ⚠️ The current-head workflow is pending, and its upgrade report contains no completed test results. The full upgrade job was not rerun locally; a completed current-head Upgrade check would confirm the change against the current merge base.
Final Verdict

Status: ✅ Approve

@clickhouse-gh clickhouse-gh Bot added pr-ci comp-ci-infrastructure CI/CD pipelines (GitHub Actions, CI scripts, runners). labels Oct 29, 2026
@alexey-milovidov alexey-milovidov added the can be tested Allows running workflows for external contributors label Oct 29, 2026
@groeneai

Copy link
Copy Markdown
Collaborator Author

CI finish ledger - ef523c8

Every failure below has an owner: a fixing PR (mine or external), or a full-effort fix task
whose fixing-PR link will be posted here when it opens. Only CH Inc sync is exempt.

Check / test Reason Owner / fixing PR
Stress test (arm_msan) / Logical error: Cannot write to canceled buffer (STID: 4158-2b4c) trunk bug, not from this PR (its diff changes only upgrade_runner.sh, which the Stress test does not run): the embedded client of the web terminal renders INSERT progress into its canceled terminal buffer (ProgressIndication::writeProgress from ClientBase::onProgress). The same STID hit 3 master runs and 9 other PRs since 2026-10-27 #127834 (external, open)
Mergeable Check, PR praktika rollups of the row above #127834 (the owner of the row above)

Upgrade check (amd_release) is green on this head. CIDB has no other FAIL or ERROR row on this head; the earlier Config Workflow failures were the attempts before the can be tested label.

Session id: cron:our-pr-ci-monitor:20261029-140003

@PedroTadim PedroTadim self-assigned this Nov 23, 2026
@clickhouse-gh clickhouse-gh Bot added the manual approve Manual approve required to run CI label Nov 23, 2026
@PedroTadim
PedroTadim enabled auto-merge November 23, 2026 14:32
@PedroTadim
PedroTadim added this pull request to the merge queue Nov 23, 2026
Merged via the queue into ClickHouse:master with commit a887b48 Nov 23, 2026
196 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 Nov 23, 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.

4 participants