Repository navigation
Conversation
`S3StorageParsedArguments::fromAST` collected every `key = value` argument but read only the keys it knows, so a misspelled, wrong-case or named-collection-only key (`SECRET_ACCESS_KEY`, `secret_acess_key`, `compression`, `google_service_account_key`, ...) was silently ignored and the request went out without it (issue ClickHouse#132003). Reject such a key with BAD_ARGUMENTS, naming the accepted keys, like the Azure parser already does. A stored definition created before this change must keep loading, so the check is skipped for a replayed definition, using the existing `is_replayed_definition` flag and `isReplayedTableDefinition` predicate: - the object-storage engines already set it; S3Queue/AzureQueue now set it too; - `CREATE TABLE ... AS s3(...)` is re-parsed through `TableFunctionFactory::get` at load, short ATTACH, RESTORE and replicated replay; those three callers now pass the predicate, and the object-storage table functions copy it into their configuration. A fresh CREATE or full-syntax ATTACH stays strict. `DatabaseS3` passed `use_environment_credentials = 1` to the `s3` function it builds; the positional parser never read that key (environment credentials are its default), so it now builds `s3(url)`, which parses identically. Tests: `04510` and `05242` passed keys the `S3` engine positional form never read; `05242` now checks the masking in the query log of the rejected CREATE. Masking itself is unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]>
`http_client` and `google_service_account_key` are accepted only through a named collection; assert that the explicit form rejects them, like `compression`. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Internal second-model review: adjudication log (click to expand)Pre-publication review by an independent model (engine: codex; 3 findings, 0 on the re-review of the fix) plus my own review.
Severity: ❌ blocker / |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-40:20261117-112300 |
|
Workflow [PR], commit [5097627] Summary: ✅
AI ReviewSummaryRejects unknown Missing context / blind spots
Final VerdictStatus: ✅ Approve |
|
@groeneai what about other table function and engines such as Azure? |
|
Measured on master (
|
…unknown-key-value-arguments
`getSourceEngineOfTableFunction` (from master) parses the `AS` table function to find the engine whose `TABLE ENGINE` grant is required. It parsed it as a fresh definition, so after the merge with master a definition stored by an older version with an unknown key-value argument, e.g. `AS s3(..., foo_bar = 'x')`, could no longer be replayed: short `ATTACH` and `RESTORE` failed in the probe of `getTablePropertiesAndNormalizeCreateQuery`, and a `Replicated` database replica replaying such a log entry failed in the probe of `getRequiredAccess` (the entry is not retriable, so the table was never created on that replica). The probe now takes the same `isReplayedTableDefinition` flag as the later parses of the table function. The grant check itself is unchanged: a replayed short `ATTACH` still requires `TABLE ENGINE ON S3`. Fresh `CREATE`, full `ATTACH` and `CREATE TABLE copy AS src` stay strict. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
The HDFS and Local named collection forms are fixed in #132410. It is based on this PR, because |
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Compile time of recompiled translation units28 translation units recompiled, 249 s compile time in total, 28 of them have a recent master baseline. |
…named-collection-unknown-override-keys Brings in ClickHouse#132354's dbec745, which passes the replay flag to the source-engine probe of `CREATE TABLE ... AS`, so a stored `AS hdfs(nc, foo_bar = 'x')` / `AS icebergLocal(...)` definition still loads on short `ATTACH` and `RESTORE`. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The engine-form `CREATE TABLE t_04510` passed `extra_credentials(role_arn = ...)`, so building its S3 client wrapped the credentials in the STS assume-role provider, and the AWS SDK signers fetch credentials while the client is constructed: three AssumeRole calls to `sts.amazonaws.com`, four attempts each. On CI runners that cannot reach it every attempt waits for the 1 s connect timeout, so the statement takes about 11 s. The flaky check runs many copies of the test at once, and they all get the same cached provider (same role, external id, endpoint and base credentials), whose reload holds a writer lock and is retried on every call while it keeps failing. The copies therefore wait for each other: in the flaky check of this PR the CREATE took 105 s at the median and up to 491 s, so runs failed with "Test runs too long" or the 300 s receive timeout. Drop `role_arn` from that CREATE and assert that it stays visible in the function-form `url_basic` statement instead. That statement fails while its arguments are parsed, before any client exists. Both forms go through the same `classifyS3Arguments` -> `maskHeadersAndExtraCredentials` path, so the masking coverage is unchanged. Locally (sts.amazonaws.com unreachable), with `--flaky-check -j 20`: before, 12 of 20 runs failed and run times grew from 31 s to 529 s; after, 50 of 50 runs passed in under 1 s each, and the server log shows no AssumeRole attempt. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…named-collection-unknown-override-keys Picks up e712844 (test-only: keeps 04510_s3_explicit_url_named_secret_mask off the network), which fixes the flaky-check timeouts of 04510 on this PR. Co-Authored-By: Claude Opus 5.5 <[email protected]>
CI finish ledger - e712844Every failure below has an owner: a fixing PR (mine or external), or a full-effort fix task
All five Session id: cron:our-pr-ci-monitor:20261117-233020 |
|
@groeneai, please investigate the CI failures in this PR (commit 316ea61) and fix them, or link existing fixes. Failures without a known issue:
|
|
The CI failure is unrelated |
CI finish ledger - 316ea61Every failure below has an owner: a fixing PR (mine or external), or a full-effort fix task
The job report also lists 3 Both merge-queue runs failed Session id: cron:clickhouse-premium-slot-28:20261120-014400 |
…-named-collection-unknown-override-keys Conflicts in the code of ClickHouse#132354: master (ClickHouse#133420) renamed `InterpreterCreateQuery::getSourceEngineOfTableFunction` to `getRequiredAccessOfTableFunction`, which returns the whole required grant, and made `ITableFunction::getSourceAccessObject` public. The replay flag of ClickHouse#132354 is passed to the renamed function at both call sites.
CI finish ledger - dd9c5e1Every failure below has an owner: a fixing PR (mine or external), or a full-effort fix task
Session id: cron:our-pr-ci-monitor:20261122-153022 |
…-named-collection-unknown-override-keys Master ClickHouse#115581 added the same replayed-definition plumbing this branch carries from ClickHouse#132354 (`TableFunctionFactory::get(..., is_replayed_definition)` and `ITableFunction::setReplayedDefinition`), storing the flag in `arguments_from_stored_definition`. Take master's version of `ITableFunction.h`, `TableFunctionFactory.h`, `InterpreterCreateQuery.h` and `DatabaseOnDisk.cpp`, read the flag from `arguments_from_stored_definition` in `TableFunctionObjectStorage::parseArgumentsImpl`, and keep the replay decision in `InterpreterCreateQuery::getRequiredAccess`, which runs on every execution, including a secondary DDL replay.
…unknown-key-value-arguments Master added the same replayed-definition flag for table functions (`ITableFunction::setReplayedDefinition`, member `arguments_from_stored_definition`) and renamed `getSourceEngineOfTableFunction` to `getRequiredAccessOfTableFunction`. Take master's versions, read the flag from `arguments_from_stored_definition` in `TableFunctionObjectStorage`, and keep passing `isReplayedTableDefinition` in `getRequiredAccess`. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Closes: #132003
Related: #107670
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
The
s3,s3Cluster,gcs,oss,cosnand S3 data lake table functions and theS3,S3Queue,GCS,OSS,COSNand S3 data lake table engines now reject akey = valueargument they do not read withBAD_ARGUMENTSinstead of silently ignoring it, so a misspelled or wrong-case key such assecret_acess_keyorSECRET_ACCESS_KEYis no longer dropped. Keys such ascompression,http_clientandgoogle_service_account_keyare accepted only through a named collection. Tables created before keep loading, but a view, refreshable materialized view or other stored query that passes such a key now fails when it runs. Closes #132003.Description
s3(..., SECRET_ACCESS_KEY = '...')orfoo_bar = '...'were accepted, the key was dropped, and the request went out without it.S3StorageParsedArguments::fromASTcollects everykey = valueargument but reads only the 13 keys it knows and never checked the rest. I copied the check the Azure parser already has (#122707): an unread key now throwsBAD_ARGUMENTSnaming the accepted keys.Stored definitions keep loading: the check is skipped for a definition replayed from metadata, using the existing
is_replayed_definitionthat the object storage engines already set.S3Queue/AzureQueuenow set it too, andCREATE TABLE ... AS s3(...)gets it at load, shortATTACH,RESTOREand replicated replay; this also gives them the existing replay rule for a named collection'sNOT OVERRIDABLE 'auto'format/structure. A freshCREATEor full-syntaxATTACHstays strict.DatabaseS3passeduse_environment_credentials = 1to thes3()call it builds. The positional parser never read that key (environment credentials are its default), so it now buildss3(url).Not changed: secret masking (a rejected query is logged as written, with only the known keys masked), and the
SETTINGS disk = ...data lake form.04510and05242passed keys theS3engine never read.Validation: the new test fails on master and passes here (50/50 randomized runs).
ENGINE = S3,S3QueueandAS s3(...)tables with an unknown key, created by a master build, load and can be detached, attached, restored from a backup and dropped.🤖 Generated with Claude Code
Workflow [PR]
Sync PR [sync-upstream/pr/132354]