Skip to content

Logical error: Nested columns sizes are inconsistent with local_discriminators column size#100148

Closed
nickitat wants to merge 1 commit intomasterfrom
column_variant_compress
Closed

Logical error: Nested columns sizes are inconsistent with local_discriminators column size#100148
nickitat wants to merge 1 commit intomasterfrom
column_variant_compress

Conversation

@nickitat
Copy link
Copy Markdown
Member

Changelog category (leave one):

  • Not for changelog (changelog entry is not required)

…cy bug

When `prepareForSquashing` in the pipeline modifies shared inner
`ColumnVariant` sub-columns (via COW bypass through `chameleon_ptr`'s
non-const `operator*`), it corrupts the `ColumnVariant` invariant:
variant total sizes no longer match discriminators size. This causes
an exception during `compress`/`decompress` in the cross join path.

The bug is pre-existing on master and is NOT caused by this branch's
changes. Tagged with `no-asan` since it crashes in debug/sanitizer builds.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@clickhouse-gh
Copy link
Copy Markdown
Contributor

clickhouse-gh bot commented Mar 19, 2026

Workflow [PR], commit [0e453aa]

Summary:

job_name test_name status info comment
Fast test failure
04043_column_variant_compress_shared_subcolumns FAIL cidb
clickhouse-test FAIL cidb
Stateless tests (amd_llvm_coverage, 1/3) failure
Server died FAIL cidb
Logical error: Nested columns sizes are inconsistent with local_discriminators column size. Total column sizes: A, local_discriminators size: B (STID: 3060-368a) FAIL cidb
Build (amd_debug) dropped
Build (amd_asan) dropped
Build (amd_tsan) dropped
Build (amd_msan) dropped
Build (amd_ubsan) dropped
Build (amd_binary) dropped
Build (arm_asan) dropped
Build (arm_binary) dropped

AI Review

Summary

This PR adds a new stateless test (04043_column_variant_compress_shared_subcolumns) that reproduces/documents a ColumnVariant consistency issue in the cross-join compression path and records the current expected result. I did not find a high-confidence correctness, safety, or performance issue in the submitted changes themselves.

Missing context

  • ⚠️ Most CI jobs are still pending, so this review is based on code/diff inspection without final CI evidence.

ClickHouse Rules

Item Status Notes
Deletion logging
Serialization versioning
Core-area scrutiny
No test removal
Experimental gate
No magic constants
Backward compatibility
SettingsChangesHistory.cpp
Safe rollout
Compilation time

Final Verdict

  • Status: ✅ Approve

@clickhouse-gh clickhouse-gh bot added the pr-not-for-changelog This PR should not be mentioned in the changelog label Mar 19, 2026
@nickitat nickitat closed this Mar 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-not-for-changelog This PR should not be mentioned in the changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant