Repository navigation
Make the delegated url('s3://...') parallel-replicas regression use a replicated destination - #121369
Merged
alexey-milovidov merged 5 commits intoOct 3, 2026
Conversation
… a replicated destination Follow-up to #120488. `test_url_s3_scheme_with_parallel_replicas` created its `INSERT ... SELECT` destination as a plain `MergeTree`. `InterpreterInsertQuery::distributedWriteIntoReplicatedMergeTreeOrDataLakeFromClusterStorage` returns early unless the destination supports replication, so the `parallel_distributed_insert_select = 2` half of the test never got as far as looking at the source storage: it only exercised the local fallback and would have passed just the same before the fix. Create the destination as a `ReplicatedMergeTree` (and give the instance a ZooKeeper) so the distributed path is entered for real. It then declines the query solely because `TableFunctionURL::executeImpl` runs the delegate with `parallel_replicas_for_cluster_engines` turned off and the delegated `url('s3://...')` therefore resolves to a plain storage rather than to an `IStorageCluster` - which is the property under test. Should the delegate ever fan out again, the forwarded query would name `urlCluster('s3://...')` and every replica would read the whole file, and the row count now catches that. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Contributor
|
Workflow [PR], commit [b371ee5] Summary: ✅ AI ReviewSummaryThis PR strengthens Final Verdict
|
…-s3-parallel-replicas-replicated-dst
…st_url_s3_scheme_with_parallel_replicas`
The row count alone could not tell "declined because the delegated `url` is not an
`IStorageCluster`" from "declined earlier for another reason". Run the same `INSERT` from
`s3('s3://...')` as a positive control: with the identical `ReplicatedMergeTree` destination and
settings, `system.query_log` must show it forwarded to all 3 replicas as `s3Cluster`, reading the
file once. The `url('s3://...')` `INSERT` must show no forwarded queries at all. The two queries
differ only in the source, so the `url` one reached the source check and was declined there.
#121369 (comment)
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…3_scheme_with_parallel_replicas` All three replicas of the `parallel_replicas` cluster are the same `node:9000`, and `Cluster::getClusterWithReplicasAsShards` skips duplicate hosts, so the cluster storage sees a single shard and the forwarded `INSERT` runs exactly once, not three times. https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=121369&sha=0b89a0fe9d69c32592c01b7b02f08c9cf4fae58c&name_0=PR&name_1=Integration%20tests%20%28amd_tsan%2C%205%2F6%29 #121369 Co-Authored-By: Claude Opus 5.5 <[email protected]>
alexey-milovidov
deleted the
followup-120488-url-s3-parallel-replicas-replicated-dst
branch
October 3, 2026 21:43
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related: #120488
Follow-up to #120488, addressing the one review thread that was still open when it merged.
test_url_s3_scheme_with_parallel_replicascreated the destination of itsINSERT ... SELECTas a plainMergeTree.InterpreterInsertQuery::distributedWriteIntoReplicatedMergeTreeOrDataLakeFromClusterStoragereturns early unless the destination is aMergeTree/data lake that supports replication, so theparallel_distributed_insert_select = 2half of that test never got as far as examining the source storage — it only exercised the local fallback, and would have passed unchanged before the fix.This creates the destination as a
ReplicatedMergeTree(and gives the test instance a ZooKeeper) so the distributed path is really entered. It then declines the query for the intended reason:TableFunctionURL::executeImplruns the delegate withparallel_replicas_for_cluster_enginesturned off, so the delegatedurl('s3://...')resolves to a plainStorageObjectStoragerather than to anIStorageCluster. That is exactly the property under test — and if the delegate ever fans out again, the forwarded query namesurlCluster('s3://...'), every replica reads the whole file, and the row-count assertion now catches it.A row count alone cannot tell "declined because of the source" from "declined earlier for another reason", so the test also runs the same
INSERTfroms3('s3://...')as a positive control: with the identical destination and settings,system.query_logmust show it forwarded ass3Cluster(once: the three replicas of the test cluster are the same host, andCluster::getClusterWithReplicasAsShardsskips duplicate hosts), reading the file once, while theurl('s3://...')INSERTmust show no forwarded queries at all.No production code changes; the distributed forwarding itself stays covered by the stateless test
05218_insert_select_auto_cluster_function_parallel_replicas, which already uses aReplicatedMergeTreedestination.Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
🤖 Generated with Claude Code
Workflow [PR]
Sync PR [sync-upstream/pr/121369]
Version info
26.10.1.1449-master(included in26.10and later)