Repository navigation
Conversation
Run the object-storage configuration check before `DESCRIBE s3` infers a schema, so `remote_url_allow_hosts` rejects the initial URL before any request.
|
Workflow [PR], commit [da5825d] Summary: ✅
AI ReviewSummaryThis PR moves Final Verdict✅ No remaining findings on the current head. LLVM Coverage ReportMeasured on commit da5825d.
Changed lines: Changed C/C++ lines covered: 31/31 (100.00%) · Uncovered code |
# Conflicts: # tests/integration/test_storage_s3/test.py
Run configuration checks before `resolveSchemaAndFormat` in `StorageObjectStorageCluster`, preventing blocked hosts from being contacted by `s3Cluster` during schema inference.
s3 URLs before schema inferences3 and s3Cluster URLs before schema inference
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Compile time of recompiled translation units110 translation units recompiled, 1012 s compile time in total, 110 of them have a recent master baseline. |
|
🕵 @groeneai, investigate the unrelated integration-test timeout: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=114357&sha=eefc929addb540d12c2d2fae25de47bbbe9bcd9f&name_0=PR&name_1=Integration%20tests%20%28amd_asan_ubsan%2C%20flaky%29 and provide a fix in a separate PR. All completed tests passed; three concurrent |
|
🕵 The unrelated |
|
The stall is not caused by
The That also answers the missing tracking issue. The job never reached its result assembly, so the A fix is already in progress: I opened #112984 on 2026-08-02. Its stated behaviour change is precisely this case, Lowering the row group count in the test would move the crossing point without removing the over-commit, and the next module to peak on that runner would wedge the same way. |
|
🕵 @groeneai, investigate the unrelated |
|
Not caused by this PR. It is a trunk regression, and the fix is already in flight: #116531 The window is merged #116128 ("Split Streaming Read Round into Aligned Metadata and Data Streams", merged 2026-08-26 08:46:40Z). CIDB has 0 rows carrying that assertion between 2026-07-01 and that merge, and 24 since: 21 different PRs plus one master run (
Two notes: #116706 touches the same file but is a micro-optimization of the aligner, not a fix; and the assertion was still firing at 13:44Z today, so re-running CI here will not clear it until #116531 lands. |
|
🕵 The current The existing fix is #112984; no change to PR 114357 is needed for this failure. |
…eation and schema inference
Backport #114357 to 26.8: Validate S3 and Azure URLs before client creation and schema inference
…eation and schema inference
Backport #114357 to 26.7: Validate S3 and Azure URLs before client creation and schema inference
Keep master's `format != "auto"` guard in `checkFormat`. It is unchanged context in #114357's diff, but it comes from a commit that is not on 26.3, and this change moves `check()` ahead of schema inference where `format` is still `auto`; without it every `format = auto` table would fail with UNKNOWN_FORMAT. Drop the post-inference `configuration->check(context)` the merge left behind in StorageObjectStorage.cpp. 26.3 has no comment above that call, so the removal hunk did not match and the new early call was simply added alongside it. In the tests, take only what belongs to this change: `remote_servers.xml` for `restricted_dummy` (not `allow_server_credentials.xml`, which does not exist on 26.3) and the new `remote_url_allow_hosts` block in test_storage_iceberg_disks. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Cherry pick #114357 to 26.3: Validate S3 and Azure URLs before client creation and schema inference
Keep master's `format != "auto"` guard in `checkFormat`. It is unchanged context in #114357's diff, but it comes from a commit that is not on 26.6, and this change moves `check()` ahead of schema inference where `format` is still `auto`; without it every `format = auto` table would fail with UNKNOWN_FORMAT. Drop the post-inference `configuration->check(context)` the merge left behind in StorageObjectStorage.cpp. 26.6 has no comment above that call, so the removal hunk did not match and the new early call was simply added alongside it. For `restricted_dummy`, add only `remote_servers.xml`; the other side also lists `allow_server_credentials.xml`, which does not exist on 26.6. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Cherry pick #114357 to 26.6: Validate S3 and Azure URLs before client creation and schema inference
…eation and schema inference
…eation and schema inference
Backport #114357 to 26.3: Validate S3 and Azure URLs before client creation and schema inference
Backport #114357 to 26.6: Validate S3 and Azure URLs before client creation and schema inference
S3::PocoHTTPClientConfiguration stores the remote host filter as a reference member (src/IO/S3/PocoHTTPClient.h:69), and so does the HTTP client built from it (:229, bound at PocoHTTPClient.cpp:221). The configuration is a freely copied value type: S3::Client keeps a whole copy (Client.h:323) and S3CredentialsProviderChain forwards it into three more configurations (Credentials.cpp:1025/1044/1096). Because the member is a reference, every copy re-binds the same referent instead of owning anything, so the filter must outlive the configuration, every copy of it, and every client and credentials provider derived from it, including providers parked for the life of the process in CredentialsProviderCache::instance() (Credentials.cpp:180-184), whose key does not include the filter. Four call sites pass a filter that dies first. Reading it afterwards is undefined behaviour; the read is the std::atomic_bool is_initialized in RemoteHostFilter::checkForDirectEntry (RemoteHostFilter.cpp:64), reached from checkURL at PocoHTTPClient.cpp:685 on a 307 and at Client.cpp:1073 on a 301. Both sit behind a redirect, which is why the class is mostly latent today. Give the filter static storage duration at each site and pass it by name. Static storage duration is process lifetime, so it dominates every retention path, including the process-wide provider cache, rather than patching one deref. Behaviour is unchanged: a default-constructed filter has is_initialized == false, so checkForDirectEntry returns true unconditionally (RemoteHostFilter.cpp:62-66) and checkURL cannot throw, which is exactly what the previously valid read would have answered. Only the storage duration changes, never the filter's contents. Same idiom as src/IO/AzureBlobStorage/PocoHTTPClient.cpp:628. Exit-time safety does not rest on static destruction order: nothing on the retention chain dereferences the filter while unwinding. ~PocoHTTPClient() is defaulted (PocoHTTPClient.h:167) and src/IO/S3/Credentials.cpp defines no destructor bodies at all. Validated under ASan with -fsanitize-address-use-after-scope. Making the read unconditional reproduces the published stack-use-after-return at __cxx_atomic_load<bool> (c11.h:81:10) with ASan naming the dead filter and its declaration line, and a two-directions arm over the credentials-provider cache aborts with a scope-local filter and passes with a static one while reaching the same read in both arms. In that ASan binary the three test sites construct the dangling binding but never read it: their clients are mocks that issue no HTTP request, or the cached provider's key is a per-test ephemeral endpoint. The production Kafka site is not bounded that way: the chain is retained in StorageKafka::oauth_context and in the process-wide provider cache, and PocoHTTPClient.cpp:545 runs its body once even at that site's s3_max_redirects = 0, so the 307 read at :685 is reachable. No new test ships. The read needs a 307/301 redirect, which no unit test induces, and detection additionally requires a sanitizer, so no shipped test can distinguish this fix. Two further call sites with the same defect, src/Coordination/KeeperSnapshotManagerS3.cpp:119 and the createTestS3Client helper in src/IO/S3/tests/gtest_aws_s3_client.cpp, are already fixed by the open PR ClickHouse#114357 and are deliberately left to it. This change touches neither of its hunks.
Validate SQL-supplied S3 and Azure endpoints before schema inference, data-lake metadata access, or Azure container probes and creation. The checks cover object-storage table functions, including
s3,s3Cluster,icebergS3,icebergS3Cluster, andazureBlobStorage, together with their persistent table creation paths.Azure client creation can issue a container existence check before the storage constructor runs. Validate the Azure configuration before constructing that client, so a blocked endpoint receives no container requests. Regression coverage checks both the rejected query and the Azure API-call counters for
CREATE TABLEandINSERT INTO TABLE FUNCTION.Server-configured S3 disks remain operator-trusted. Selecting an explicitly allowed configured S3 disk from SQL does not turn its endpoint into a user-provided URL.
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Apply
remote_url_allow_hostsbefore SQL-supplied S3 and Azure endpoints send schema, metadata, or container requests.Workflow [PR]
Sync PR [sync-upstream/pr/114357]
Version info
26.9.1.1220(included in26.9and later)26.8.3.97,26.7.7.86,26.6.7.18,26.3.33.80