Skip to content

Allow DROP PARTITION on DataLakeCatalog Iceberg tables with parallel replicas - #126136

Merged
scanhex12 merged 1 commit into
ClickHouse:masterfrom
groeneai:groeneai/iceberg-cluster-drop-partition
Oct 16, 2026
Merged

scanhex12 merged 1 commit into
ClickHouse:masterfrom
groeneai:groeneai/iceberg-cluster-drop-partition

Conversation

@groeneai

@groeneai groeneai commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator

Closes: #124988
Related: #122269

Changelog category (leave one):

  • Not for changelog (changelog entry is not required)

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

Not required: DROP PARTITION on catalog tables (#122269) is not in any release yet.

Description

With parallel replicas enabled for cluster engines (enable_parallel_replicas, cluster_for_parallel_replicas, parallel_replicas_for_cluster_engines = 1), ALTER TABLE <DataLakeCatalog db>.<Iceberg table> DROP PARTITION ... fails with Code: 48 ... Table engine IcebergS3 doesn't support partitioning (NOT_IMPLEMENTED). The same statement without parallel replicas drops the partition.

Root cause: in this mode DatabaseDataLake returns a StorageObjectStorageCluster. #119214 made it forward the write and DDL entry points (write, mutate, alter, drop, ...) to the same configuration and catalog that StorageObjectStorage uses, but not checkAlterPartitionIsPossible / alterPartition, so the IStorage defaults throw.

Change: forward both exactly as StorageObjectStorage does. The data lake metadata still decides which partition commands and catalogs are allowed, so partition commands behave the same with and without parallel replicas. I checked this locally for DETACH PARTITION, DROP PART, FREEZE PARTITION and allow_insert_into_iceberg = 0, which give identical errors in both modes.

Validation: the new integration test test_drop_partition_catalog_parallel_replicas fails on master with the error above (4/4) and passes with the fix (50/50 over five random-settings draws). The other drop_partition, test_cluster_insert, test_cluster_select and test_insert* tests of test_database_iceberg pass.

#126097 fixes ALTER TABLE ... DELETE / UPDATE through the same wrapper; the two changes are independent.


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

Version info

  • Merged into: 26.11.1.79-master (included in 26.11 and later)

With parallel replicas usable for cluster engines, `DatabaseDataLake`
serves catalog tables through `StorageObjectStorageCluster`. ClickHouse#119214 made
that wrapper forward the catalog write and DDL entry points to the same
configuration and catalog that `StorageObjectStorage` uses, but not
`checkAlterPartitionIsPossible` / `alterPartition`. So
`ALTER TABLE <catalog table> DROP PARTITION` (ClickHouse#122269) reached the
`IStorage` defaults and failed with
`Table engine IcebergS3 doesn't support partitioning (NOT_IMPLEMENTED)`.

Forward both exactly as `StorageObjectStorage` does. Which partition
commands and catalogs are allowed stays decided by the data lake metadata,
so the result is the same as with parallel replicas off.

Closes ClickHouse#124988

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; 1 finding) plus my own cold review (1 nit).

# Sev Finding Verdict Evidence / action
1 ⚠️ The new test checks only rows, so it would pass if DatabaseDataLake stopped returning StorageObjectStorageCluster DISAGREE Wrapper selection depends only on settings the test pins (not randomized); master fails 4/4 with Code: 48 from IStorage::checkAlterPartitionIsPossible, reachable only via the wrapper; no non-test-only observable tells the storages apart.
2 💡 The new test repeats test_drop_partition_catalog_backed with different settings noted, not blocking could be a parametrization

Severity: ❌ blocker / ⚠️ major / 💡 nit. DISAGREE verdicts carry recorded evidence and are terminal per finding.

Session id: cron:clickhouse-review-slot-8:20261015-211300

@groeneai

Copy link
Copy Markdown
Collaborator Author
Pre-PR validation gate (click to expand)
# Question Answer
a Deterministic repro? Yes. test_database_iceberg/test.py::test_drop_partition_catalog_parallel_replicas fails on the master binary 4/4 with Code: 48 ... Table engine IcebergS3 doesn't support partitioning (NOT_IMPLEMENTED) from IStorage::checkAlterPartitionIsPossible.
b Root cause explained? Yes. With parallel replicas for cluster engines, DatabaseDataLake returns StorageObjectStorageCluster, which forwards write/mutate/alter/drop but not checkAlterPartitionIsPossible/alterPartition, so InterpreterAlterQuery reaches the IStorage defaults.
c Fix matches root cause? Yes. Both methods are forwarded exactly as StorageObjectStorage does; no guard, setting or catalog-specific code.
d Test intent preserved / new tests added? New integration test next to the existing test_drop_partition_catalog_* tests; no existing test changed.
e Both directions demonstrated? Yes. 4/4 FAIL on the master binary, 50/50 PASS on the fix binary (Build-IDs differ), five random-settings draws.
f Fix is general across code paths? Yes. Among the overriders of these two methods, StorageObjectStorageCluster is the only catalog-reachable wrapper that lacked them; its other DDL entry points were already forwarded.
g Fix generalizes across inputs (params/datatypes/wrappers)? Yes. IcebergMetadata still decides commands and catalogs; DETACH PARTITION, DROP PART, FREEZE PARTITION and allow_insert_into_iceberg = 0 give the same errors with and without parallel replicas (measured).
h Backward compatible? (maintainer-approved exception only) Yes. No setting or format change; only statements that threw NOT_IMPLEMENTED now run.
i Invariants and contracts preserved? Yes. Same locks as the StorageObjectStorage path; the configuration is initialized in the wrapper constructor before the metadata checks; no new error path.

Session id: cron:clickhouse-impl-slot-41:20261015-205000

@clickhouse-gh

clickhouse-gh Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [f5f2dcf]

Summary: ✅


AI Review

Summary

Reviewed #126136 at f5f2dcf967a2db0962a354ab5f57c8ee4f2ddce4. The change forwards partition validation and execution through StorageObjectStorageCluster, enabling catalog-backed Iceberg DROP PARTITION with parallel replicas. No actionable findings.

Missing context / blind spots
  • ⚠️ The integration test was not executed locally during this review, and CI builds were still queued or running. The author reports that the regression test fails on master and passes with the fix in the validation discussion. A completed CI run of test_drop_partition_catalog_parallel_replicas would independently confirm that evidence.
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 Oct 15, 2026
@groeneai

Copy link
Copy Markdown
Collaborator Author

cc @scanhex12 @Michicosun, could you review this and add the can be tested label (I cannot add it, so CI stopped at Config Workflow)? With parallel replicas, DatabaseDataLake returns StorageObjectStorageCluster, which forwarded the other DDL entry points since #119214 but not checkAlterPartitionIsPossible / alterPartition, so catalog DROP PARTITION hit the IStorage default; this forwards both like StorageObjectStorage does.

@alexey-milovidov alexey-milovidov added the can be tested Allows running workflows for external contributors label Oct 15, 2026
@clickhouse-gh clickhouse-gh Bot added the comp-datalake Data lake table formats (Iceberg/Delta/Hudi) integration. label Oct 15, 2026
@scanhex12
scanhex12 added this pull request to the merge queue Oct 16, 2026
Merged via the queue into ClickHouse:master with commit 3527341 Oct 16, 2026
352 of 353 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 Oct 16, 2026
@robot-clickhouse-ci-2 robot-clickhouse-ci-2 added the pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR label Nov 3, 2026
@robot-clickhouse-ci-2 robot-clickhouse-ci-2 added the pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore label Nov 3, 2026
clickhouse-gh Bot added a commit that referenced this pull request Nov 3, 2026
Backport #126136 to 26.10: Allow `DROP PARTITION` on `DataLakeCatalog` Iceberg tables with parallel replicas
leshikus pushed a commit that referenced this pull request Nov 13, 2026
…` Iceberg tables with parallel replicas
@clickhouse-gh clickhouse-gh Bot added comp-iceberg Apache Iceberg tables: reading and writing Iceberg metadata (snapshots, manifests, schema evoluti... and removed comp-datalake Data lake table formats (Iceberg/Delta/Hudi) integration. labels Nov 22, 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-iceberg Apache Iceberg tables: reading and writing Iceberg metadata (snapshots, manifests, schema evoluti... pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR pr-not-for-changelog This PR should not be mentioned in the changelog pr-synced-to-cloud The PR is synced to the cloud repo v26.10-must-backport

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Catalog DROP PARTITION not forwarded by StorageObjectStorageCluster

6 participants