Skip to content

Antalya 25.8 Backport of #102156 - Fix Nullable(X)->Y cross-type ALTER MODIFY COLUMN - #2710

Merged
zvonand merged 2 commits into
antalya-25.8from
backports/antalya-25.8/102156
Oct 27, 2026
Merged

zvonand merged 2 commits into
antalya-25.8from
backports/antalya-25.8/102156

Conversation

@zvonand

@zvonand zvonand commented Oct 27, 2026

Copy link
Copy Markdown
Member

Changelog category (leave one):

  • Bug Fix

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

Fixed ALTER MODIFY COLUMN failing when converting a Nullable column to a different type with a DEFAULT (e.g. Nullable(UInt8) → String,LowCardinality(String), or Array(UInt8)). (ClickHouse#102156 by @il9ue)

Documentation entry for user-facing changes

...

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)

Michicosun and others added 2 commits October 27, 2026 14:13
…pe-modify-upstream

Fix Nullable(X)->Y cross-type ALTER MODIFY COLUMN

Conflicts committed as-is; the next commit resolves them:
- src/Interpreters/inplaceBlockConversions.cpp (both modified)
Resolved the inplaceBlockConversions.cpp conflict (antalya-25.8 uses std::make_shared) and dropped test Case 9, which needs Nullable(Tuple) support antalya-25.8 lacks.
@zvonand

zvonand commented Oct 27, 2026

Copy link
Copy Markdown
Member Author

Backporter: cherry-pick conflicts resolved by AI

Conflicted files:

  • src/Interpreters/inplaceBlockConversions.cpp (both modified)

Commits:

  • 5cf4427: cherry-pick with the conflicts committed as-is

  • 1dd1eb6: resolution

  • src/Interpreters/inplaceBlockConversions.cpp: the conflict is in convertRequiredExpressions. I kept the upstream branching: ifNull(_CAST(col,'Nullable(T)'), _CAST(default,'T')) when the target type can be wrapped in Nullable, and if(isNull(col), …, _CAST(assumeNotNull(col),'T')) when it can't. It is written with antalya-25.8's std::make_shared style.

  • tests/queries/0_stateless/03575_modify_column_null_to_default_cross_type.sql: removed Case 9 (the Map target with a Nullable(Tuple) source), because allow_experimental_nullable_tuple_type and Nullable(Tuple) don't exist in antalya-25.8.

  • tests/queries/0_stateless/03575_modify_column_null_to_default_cross_type.reference: removed Case 9's output lines ({} a, {'a':1} b).

@github-actions

Copy link
Copy Markdown

Workflow [PR], commit [1dd1eb6]

@zvonand

zvonand commented Oct 27, 2026

Copy link
Copy Markdown
Member Author

@blau-ai

@blau-ai

blau-ai commented Oct 27, 2026

Copy link
Copy Markdown
Collaborator

CI triage for 1dd1eb6

There are 2 red checks. Neither is caused by this PR. One is a known flaky crash from upstream, the other is the DCO check that also fails on other merged backports. The PR gate is red only because of these two.

Check Classification PR-caused?
Stateless tests (amd_debug, AsyncInsert, s3 storage, sequential) Known upstream crash in the mutation path (ClickHouse#102153) ❌ No
DCO No Signed-off-by on the backport commits. Fails the same way on other backports ❌ No

All other checks that ran passed, including the regression suites. The new test 03575_modify_column_null_to_default_cross_type passed in every stateless job.


1. Stateless tests (amd_debug, AsyncInsert, s3 storage, sequential): server abort

The test that failed is 00992_system_parts_race_condition_zookeeper_long. It failed with server died. The server hit a logical error in a background mutation on a replicated table:

<Fatal> : Logical error: 'Part 2_0_117_1_115 with metadata version 14 contains column h that is absent in table test_8izlr8bw.alter_table1 (...) with metadata version 12'.
5. src/Storages/MergeTree/MutateTask.cpp:368: DB::MutationHelpers::splitAndModifyMutationCommands
6. src/Storages/MergeTree/MutateTask.cpp:2616: DB::MutateTask::prepare
7. src/Storages/MergeTree/MutateTask.cpp:2358: DB::MutateTask::execute

The follow-up results (Killed by signal, Fatal messages, Logical error thrown) come from this same abort.

Why this is not the PR:

  • The PR only changes the Nullable(X) -> Y branch of convertRequiredExpressions in src/Interpreters/inplaceBlockConversions.cpp. That code runs when a part is read, to convert old column data to a new type.
  • The crash happens earlier, in a check in splitAndModifyMutationCommands. It compares the part's metadata version with the table's metadata version, and it fails before any column conversion runs.
  • The test does ADD COLUMN h String → MODIFY COLUMN h UInt64 → DROP COLUMN h while replicas run concurrently. That is a String → UInt64 change and never reaches the Nullable branch the PR touches. The race is between replicas applying metadata versions.
  • Upstream has the same stack frames splitAndModifyMutationCommands → MutateTask::prepare → ReplicatedMergeMutateTaskBase::executeImpl as an open CI crash, [CI crash] Mutation command splitting failed during alter operation ClickHouse/ClickHouse#102153. There it showed up in upstream master CI and in an unrelated upstream PR.

Next step: safe to re-run this job. If it keeps showing up on antalya-25.8, the upstream fix for ClickHouse#102153 is the thing to backport, not a change to this PR.

2. DCO

Neither commit has a Signed-off-by line: 5cf44271cb is the upstream merge commit and 1dd1eb6183 is the conflict resolution. DCO fails the same way on the sibling backport #2709 and on the already-merged backports #2695 and #2673. Nothing needs fixing. If you do want it green, it needs git commit --amend -s plus a force-push, and I can't do force-pushes.


Overall: nothing in CI points at the backport itself, so I suggest no code changes to this PR.

@zvonand
zvonand merged commit d68e4f1 into antalya-25.8 Oct 27, 2026
239 of 243 checks passed
@zvonand zvonand added the verified Approved for release label Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants