Skip to content

Backport #108674 to 26.3: Do not validate DataLakeCatalog auth_header or build catalog on ATTACH - #108893

Merged
alexey-milovidov merged 2 commits into
26.3from
backport/26.3/108674
Jun 30, 2026
Merged

alexey-milovidov merged 2 commits into
26.3from
backport/26.3/108674

Conversation

@robot-clickhouse

@robot-clickhouse robot-clickhouse commented Jun 30, 2026 •

Copy link
Copy Markdown
Member

Original pull-request #108674
Cherry-pick pull-request #108792

This pull-request is a last step of an automated backporting.
Treat it as a standard pull-request: look at the checks and resolve conflicts.
Merge it only if you intend to backport changes to the target branch, otherwise just close it.

The PR source

The PR is created in the CI job

Version info

  • Merged into: 26.3.17.11

@robot-clickhouse robot-clickhouse added pr-backport Changes, backported to release branch. Do not use manually - automated use only! pr-bugfix Pull request with bugfix, not backported by default labels Jun 30, 2026
@clickhouse-gh

clickhouse-gh Bot commented Jun 30, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [BackportPR], commit [ca3ae21]

Summary: ✅

`CHECK DATABASE` does not exist in the 26.3 SQL grammar (it was introduced in
26.4 together with the `IDatabase::checkDatabase` mechanism that
`InterpreterCheckQuery` calls). As a result both `CHECK DATABASE baddb` and
`CHECK DATABASE ${FORBIDDEN_DB}` failed with `SYNTAX_ERROR`, so the expected
`Unexpected format of auth header` and `is forbidden` lines were never produced
and the test failed with a result diff.

Trigger the lazy catalog construction with a `SELECT` against the database
instead. `getCatalog` is built (and the malformed or forbidden `auth_header`
rejected) before any table is resolved, so the referenced table need not exist.
Unlike `CHECK DATABASE`, this path propagates the error on every branch, so it
keeps the test's intent (the error is reported lazily on first use) without
depending on the `checkDatabase` infrastructure that 26.3 lacks.

Verified against the 26.3 build from the failing CI run, running the test
server with the `forbidden_headers.xml` config: the output now matches the
reference exactly.

PR: #108893
CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=108893&sha=54084a194a35e4c9787b837baa6cfb9b9a7e1d1a&name_0=BackportPR&name_1=Stateless%20tests%20%28amd_asan%2C%20distributed%20plan%2C%20parallel%2C%202%2F2%29

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@alexey-milovidov

Copy link
Copy Markdown
Member

Fixed the failing 04401_datalake_attach_does_not_block_startup (commit ca3ae21).

Root cause: the backported test used CHECK DATABASE, but that syntax does not exist in 26.3 — it was introduced in 26.4 together with the IDatabase::checkDatabase mechanism that InterpreterCheckQuery calls. On 26.3 both CHECK DATABASE baddb and CHECK DATABASE ${FORBIDDEN_DB} fail with SYNTAX_ERROR, so the expected Unexpected format of auth header and is forbidden lines were never produced (result diff — both lines missing, see the CI report).

The source backport itself is correct: 26.3 already builds the catalog lazily in getCatalog (the constructor only calls validateSettings), so the two backported hunks — the CREATE-only auth_header validation guard in registerDatabaseDataLake and the http_forbid_headers check in the RestCatalog constructor — are sufficient, and the .h/lazy_init refactor from the original PR is correctly omitted (it is unnecessary on 26.3).

Fix: trigger the lazy catalog construction with a SELECT against the database instead of CHECK DATABASE. getCatalog is built (and the malformed/forbidden auth_header rejected) before any table is resolved, so the referenced table need not exist, and this path propagates the error on every branch — keeping the test's intent (lazy rejection on first use) without depending on the checkDatabase infrastructure that 26.3 lacks.

Verification: downloaded the 26.3 build (26.3.17.7) from this PR's failing CI run and ran the test against a server started with the test forbidden_headers.xml config — the output now matches the reference exactly.

@alexey-milovidov
alexey-milovidov merged commit d9be466 into 26.3 Jun 30, 2026
34 checks passed
@alexey-milovidov
alexey-milovidov deleted the backport/26.3/108674 branch June 30, 2026 19:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-backport Changes, backported to release branch. Do not use manually - automated use only! pr-bugfix Pull request with bugfix, not backported by default

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants