Skip to content

Antalya 26.8, frontport: Fix GROUP BY server constants over s3Cluster and object_storage_cluster - #2575

Merged
zvonand merged 5 commits into
antalya-26.8from
bugfix/antalya-26.8/2139-hostname-object-storage-cluster
Oct 18, 2026
Merged

zvonand merged 5 commits into
antalya-26.8from
bugfix/antalya-26.8/2139-hostname-object-storage-cluster

Conversation

@ianton-ru

Copy link
Copy Markdown

Frontport of #2490 from antalya-26.6 to antalya-26.8.

The old analyzer drops constant GROUP BY keys when distributed_depth is 0. Cluster table function workers never increase that depth, so a key such as hostName was folded and the initiator aggregated only the count. The fix keeps a folded server constant on a secondary query and still drops ordinary constants, including __getScalar and local server constants.

Related: #2490
Related: #2139

Changelog category (leave one):

  • Bug Fix (user-visible misbehavior in an official stable release)

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):

Fix GROUP BY server constants over s3Cluster and object_storage_cluster.

Documentation entry for user-facing changes

None.

CI/CD Options

Exclude tests:

  • Fast test
  • Integration Tests
  • Stateless tests
  • Stateful tests
  • Unit tests
  • Performance tests
  • Aarch64 tests
  • All with ASAN
  • All with TSAN
  • All with MSAN
  • All with UBSAN
  • All with Coverage
  • All Regression
  • Disable CI Cache

Regression jobs to run:

  • Fast suites (mostly <1h)
  • Aggregate Functions (2h)
  • Alter (1.5h)
  • Benchmark (30m)
  • CAS (content-addressed storage; Antalya only)
  • ClickHouse Keeper (1h)
  • Iceberg (2h)
  • LDAP (1h)
  • OAuth (5m)
  • Parquet (1.5h)
  • RBAC (1.5h)
  • SSL Server (1h)
  • S3 (2h)
  • S3 Export (2h)
  • Swarms (30m)
  • Tiered Storage (2h)

ianton-ru and others added 4 commits October 15, 2026 15:46
The old analyzer drops constant GROUP BY keys when distributed_depth is 0. Cluster table function reads never increased that depth, so workers folded hostName() and returned only the aggregate.

https: //github.com//issues/2139
Co-authored-by: Cursor <cursoragent@cursor.com>
Raising distributed_depth on cluster reads also changes parallel replicas, max_distributed_depth, and block marshalling. The old analyzer now keeps a key such as hostName() and still drops ordinary constants.

https: //github.com//issues/2139
Co-authored-by: Cursor <cursoragent@cursor.com>
__getScalar is marked as a server constant, but the initiator evaluates it and sends the same value to every shard. Keeping it made GROUP BY of a scalar subquery with Dynamic throw ILLEGAL_COLUMN.

https: //github.com//pull/2490
Co-authored-by: Cursor <cursoragent@cursor.com>
A local query has one server, so a folded server constant is an ordinary constant. Keeping it made GROUP BY of `hostName` cast to `Dynamic` throw `ILLEGAL_COLUMN`. Secondary queries still keep the key, because cluster table function workers also have `distributed_depth` 0.

https: //github.com//pull/2490
Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Workflow [PR], commit [44cc3cb]

@ianton-ru ianton-ru changed the title Fix GROUP BY server constants over s3Cluster and object_storage_cluster Antalya 26.8, frontport: Fix GROUP BY server constants over s3Cluster and object_storage_cluster Oct 15, 2026
@ianton-ru ianton-ru added antalya port-antalya PRs to be ported to all new Antalya releases antalya-26.8 Session label (releasy session config) labels Oct 15, 2026
`getManifestFileEntriesHandle` and `generateManifestList` take the cache after external-path support, but `AlterDropPartitionExecutor` still used the old signatures, so the amd binary build failed.

https: //altinity-build-artifacts.s3.amazonaws.com/json.html?PR=2575&sha=de846f87651f582609e740036d2a9ba9db179950&name_0=PR&name_1=Build%20%28amd_binary%29
https: //github.com//pull/2575
Co-authored-by: Cursor <cursoragent@cursor.com>
ianton-ru added a commit that referenced this pull request Oct 15, 2026
`getManifestFileEntriesHandle` and `generateManifestList` take the cache after external-path support, but `AlterDropPartitionExecutor` still used the old signatures, so the amd binary build failed.

https: //altinity-build-artifacts.s3.amazonaws.com/json.html?PR=2575&sha=de846f87651f582609e740036d2a9ba9db179950&name_0=PR&name_1=Build%20%28amd_binary%29
https: //github.com//pull/2575
Co-authored-by: Cursor <cursoragent@cursor.com>
@ianton-ru ianton-ru mentioned this pull request Oct 15, 2026
52 tasks done
@zvonand zvonand added the forwardport This is a frontport of code that existed in previous Antalya versions label Oct 16, 2026
@zvonand

zvonand commented Oct 18, 2026

Copy link
Copy Markdown
Member

@blau-ai

@blau-ai

blau-ai commented Oct 18, 2026

Copy link
Copy Markdown
Collaborator

@zvonand CI triage for this PR (commit 44cc3cb).

Verdict: 5 failing checks, 0 caused by this PR

All failures are either pre-existing on the antalya-26.8 base branch or CI infra/runner flakes. Every functional test suite that actually ran is green, including the three new tests this PR adds. No code change is needed — just re-runs of two infra-flaky jobs.

Strongest evidence: two unrelated PRs on the same base, #2578 (Iceberg cluster metadata) and #2586 (Antalya protocol trailer), show the identical set of red checks (oauth, swarms, both Grype scans). And the original PR this frontports, #2490 (base antalya-26.6), passed oauth and swarms — the diff here is behaviorally the same, only the base branch differs.

Per-failure breakdown

1. Grype Scan (keeper: 4 high/critical, server-alpine: 1) — not PR-related
Container-image CVE scans of base/runtime image dependencies; this PR only touches C++ source (ExpressionAnalyzer, Iceberg). Identical counts on #2578 and #2586. Pre-existing on antalya-26.8. → Separate dependency-bump concern, not a blocker for this PR.

2. Integration tests (amd_asan_ubsan, targeted) — infra flake, re-run
Status ERROR, info: "Job failed to produce Result due to a script error or CI runner issue". No tests executed — this is a runner failure, not a test failure. The full old-analyzer integration matrix (amd_asan_ubsan, db disk, old analyzer, 1/8…8/8) — which exercises exactly the code path this PR changes — passed with 0 failures in every shard, and this same targeted job passed on #2490. → Safe to re-run.

3. Parser memory check — infra/setup, re-run
Status ERROR, sub-step "Resolve master binary: No master clickhouse-examples artifact was found". The check needs a baseline master binary to diff against and couldn't fetch one; unrelated to the diff. → Re-run once the master artifact is available.

4. Regression release oauth — pre-existing on base (9/112 scenarios failed)
OAuth/identity-provider testing has no connection to GROUP BY or Iceberg. Passed on #2490 (26.6 base), fails identically on the unrelated 26.8 PRs #2578 and #2586. → Pre-existing base-branch issue.

5. Regression release swarms — pre-existing on base (4/1535 scenarios failed)
Despite the topical adjacency to object-storage clusters, this is the same base-branch failure: passed on #2490, and fails identically on #2578/#2586. → Pre-existing; not introduced by this change.

PR health check

Green where it counts. Fast test (0 failed), Stateless amd_debug parallel (13269 passed / 0 failed), sequential, distributed-plan s3 storage, and amd_asan_ubsan selected — all 0 failed. Integration old-analyzer shards 1–8 all 0 failures. Unit tests asan_ubsan (20701 / 0). Stress tests, AST fuzzer, BuzzHouse, SQLLogic, SQLStorm all OK. The three new regression tests added here — 05296_s3_cluster_hostname_group_by, 05297_scalar_subquery_group_by_old_analyzer, 05298_local_server_constant_group_by_old_analyzer — ran inside the stateless suites and passed. From this PR's standpoint CI is effectively green; the red marks are base-branch/infra noise shared by all current antalya-26.8 PRs.

(Analysis from CI reports only — I can't build or run ClickHouse in this environment; correctness is ultimately validated by the green functional suites above.)

@zvonand
zvonand merged commit b147878 into antalya-26.8 Oct 18, 2026
279 of 291 checks passed
@zvonand zvonand added the verified Approved for release label Oct 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

antalya antalya-26.8 Session label (releasy session config) forwardport This is a frontport of code that existed in previous Antalya versions port-antalya PRs to be ported to all new Antalya releases verified Approved for release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants