Repository navigation
Parallel replicas for object storage writes - #119214
Conversation
|
Workflow [PR], commit [c9a93c9] Summary: ✅
AI ReviewSummaryThe PR makes Findings
Tests
Final Verdict
LLVM Coverage ReportMeasured on commit c9a93c9.
Changed lines: Changed C/C++ lines covered: 45/67 (67.16%) · Uncovered code |
Covers the `catalog == nullptr` side of `StorageObjectStorageCluster::write`: an Iceberg table that is not managed by a catalog, written through `icebergS3Cluster`, which used to throw `Method write is not supported by storage IcebergS3`. The engine table and the plain `icebergS3` table function are checked in the same test, because with parallel replicas enabled neither is converted to the cluster variant for an `INSERT` - the engine table is never auto-converted, and `TableFunctionObjectStorage::executeImpl` guards the conversion with `!is_insert_query`. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
| ContextPtr context, | ||
| bool async_insert) override; | ||
|
|
||
| bool isDataLake() const override { return configuration->isDataLakeConfiguration(); } |
There was a problem hiding this comment.
StorageObjectStorage reports data-lake tables as replicated, but this wrapper still inherits IStorage::supportsReplication() == false. That changes real control flow once DatabaseDataLake::tryGetTableImpl starts returning StorageObjectStorageCluster for writes under parallel_replicas_for_cluster_engines: InterpreterInsertQuery::distributedWriteIntoReplicatedMergeTreeOrDataLakeFromClusterStorage bails out on !dst_storage->supportsReplication(), so INSERT INTO <catalog table> SELECT ... FROM icebergS3Cluster(...) never reaches the distributed data-lake write path.
The generic parallel_distributed_insert_select = 2 fallback does not rescue this shape either, because ClusterProxy::isSuitableForInsertSelectWithParallelReplicas only recognizes ReadFromParallelRemoteReplicasStep, while *Cluster reads build ReadFromCluster. Could we mirror StorageObjectStorage::supportsReplication() here for data-lake configurations and add an INSERT ... SELECT regression test?
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Object file sizes7 object files changed (+27.51 KiB total), 0 added.
716 more object files are built by the master warmup baseline only (it builds every object-file target, a pull request build only Compile time of recompiled translation units99 translation units recompiled, 948 s compile time in total, 99 of them have a recent master baseline. |
Backport #119214 to 26.8: Parallel replicas for object storage writes
Backport #119214 to 26.7: Parallel replicas for object storage writes
Backport #119214 to 26.6: Parallel replicas for object storage writes
Cherry pick #119214 to 26.3: Parallel replicas for object storage writes
…ables Restore `StorageObjectStorageCluster::write` (from the upstream backport of ClickHouse#119214) that was lost while resolving the port: direct inserts such as `INSERT ... VALUES` and async inserts are written from the initiator via `pure_storage`, instead of reaching `IStorageCluster::write`, which throws `Method write is not supported` when a cluster name is set. Fixes `test_database_iceberg/test.py::test_cluster_insert` and `test_storage_iceberg_no_spark/test_writes_parallel_replicas_no_catalog.py`. #2399 (comment) #2399
`05077_iceberg_equality_delete_nullability_mismatch`: absolute data and metadata paths inside the table `location` are mapped under the table root by the path resolver, so they are no longer checked against `user_files` as raw paths. The check requires that the remainder after `location` does not climb out of it, so a crafted path cannot escape the table root. `test_cluster_insert`, `test_writes_parallel_replicas_no_catalog`: `StorageObjectStorageCluster::write` always writes on the initiator, as introduced upstream by the backport of ClickHouse#119214 instead of throwing `NOT_IMPLEMENTED` when a cluster is set. CI report: #2481 (comment) PR: #2481 Signed-off-by: Andrey Zvonov <[email protected]>
With parallel replicas for cluster engines, `DatabaseDataLake` returns a `StorageObjectStorageCluster` for every statement, and its `mutate` (added in ClickHouse#119214) passed itself as the mutation's read source. `Iceberg::writeDataFiles` builds `MutationsInterpreter` over that storage; for a non-MergeTree source it reads with a synthetic `SELECT <columns> WHERE <predicate>` that has no table expression, and `IStorageCluster::read` re-analyzes that query to build the per-replica query, so the virtual columns cannot be resolved: `Unknown expression identifier _row_id (UNKNOWN_IDENTIFIER)` for `ALTER TABLE ... DELETE`, `ALTER TABLE ... UPDATE` and `DELETE FROM`. Pass a transient local `StorageObjectStorage` of the same table as the read source instead, built with the arguments `DatabaseDataLake` uses without parallel replicas (`is_table_function` so the constructor never creates the table in the catalog, `lazy_init` so it does no object storage request). The metadata refresh and the metadata snapshot stay with the cluster storage, so the mutation runs against the state the interpreter validated, and the read storage needs no refresh of its own. The mutation read runs on the initiator, as it does without parallel replicas. Closes ClickHouse#122161 Co-Authored-By: Claude Opus 5.5 <[email protected]>
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]>
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Support parallel replicas for object storage writes
Workflow [PR]
Sync PR [sync-upstream/pr/119214]
Version info
26.8.3.87,26.7.8.7,26.6.6.12