Repository navigation
Cherry pick #108674 to 26.3: Do not validate DataLakeCatalog auth_header or build catalog on ATTACH - #108792
Conversation
A DataLakeCatalog database whose auth_header was accepted by an older version (which validated it lazily) became un-attachable after upgrading to 26.2+. The auth_header validation in registerDatabaseDataLake ran on ATTACH as well as CREATE, so at startup one database with a malformed auth_header threw BAD_ARGUMENTS during attach and the server failed to start (exit 36). On master the constructor additionally builds the catalog eagerly (RestCatalog reads the catalog config over the network), so any database with an unreachable endpoint also failed to attach at startup. Gate the auth_header validation on CREATE only, matching the existing allow_experimental_database_* gates in the same function which already self-skip on attach. Defer catalog construction to first use on ATTACH so that attach performs no validation or network I/O; the catalog is built lazily in getCatalog under catalog_mutex (the eager construction was originally a race fix, so lazy init is now synchronized). CREATE still builds eagerly and rejects malformed headers up front. A malformed auth_header is reported lazily on first use of the database, as it was before, so one misconfigured database can no longer block server startup. Co-Authored-By: Claude Opus 4.8 <[email protected]>
The startup-block fix gated auth_header validation in registerDatabaseDataLake to CREATE only. That validation was also the only place enforcing http_forbid_headers for a persisted auth_header, so old metadata carrying a forbidden header would attach and then send it on first use, even though CREATE still rejects it. Run the forbidden-header check in the RestCatalog constructor, right after the header is parsed and before loadConfig issues the first request. That is where a user-provided auth_header first becomes a header sent to the catalog, so the check covers the deferred first-use path without reintroducing the startup block (the catalog is still built lazily on ATTACH). The CREATE path is unchanged. Extend 04401_datalake_attach_does_not_block_startup: a persisted forbidden auth_header attaches (no startup block) but is rejected on first use. The forbidden-header filter is read only by the server, so that part runs against the test server. Co-Authored-By: Claude Opus 4.8 <[email protected]>
…rtup_108671 Do not validate DataLakeCatalog auth_header or build catalog on ATTACH
Adapt cherry-pick of #108674 ("Do not validate DataLakeCatalog `auth_header` or build catalog on ATTACH") to 26.3, where the catalog is already built lazily. On `master` the fix had two parts: gate the `auth_header` validation in `registerDatabaseDataLake` on `CREATE` only, and defer eager catalog construction (`DatabaseDataLake::initialize` called from the constructor) to first use on `ATTACH`. In 26.3 the constructor only calls `validateSettings` and the catalog is already built lazily inside `getCatalog` (there is no `initialize` method and `catalog_impl` is already `mutable`), so the second part of the change does not apply and would not even compile against 26.3. Resolution: - `DatabaseDataLake.h`: kept unchanged (the `lazy_init` constructor parameter, `catalog_mutex`, and `initialize` declaration from `master` do not exist in 26.3). - `DatabaseDataLake.cpp`: applied only the `registerDatabaseDataLake` gate (`if (!args.create_query.attach && !auth_header_str.empty())`), which is the part that fixes the 26.3 startup failure. The constructor/`initialize`/`getCatalog` changes were dropped. - `RestCatalog.cpp`: kept the `http_forbid_headers` enforcement on the lazy `RestCatalog` constructor path and the `Common/HTTPHeaderFilter.h` include (auto-merged cleanly; 26.3 also builds the catalog lazily, so this is where a forbidden persisted header is first rejected). - Added the test `04401_datalake_attach_does_not_block_startup`. The resulting diff against the backport base is exactly the four files of the adapted fix; `DatabaseDataLake.h` is unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
Resolved the conflicts so this cherry-pick of #108674 applies cleanly to The PR could not be cherry-picked verbatim because
In Resolution:
The test exercises both |
Original pull-request #108674
Do not merge this PR manually
This pull-request is a first step of an automated backporting.
It contains changes similar to calling
git cherry-picklocally.If you intend to continue backporting the changes, then resolve all conflicts if any.
Otherwise, if you do not want to backport them, then just close this pull-request.
The check results does not matter at this step - you can safely ignore them.
Troubleshooting
If the conflicts were resolved in a wrong way
If this cherry-pick PR is completely screwed by a wrong conflicts resolution, and you want to recreate it:
pr-cherrypicklabel from the PRYou also need to check the Original pull-request for
pr-backports-createdlabel, and delete if it's presented thereThe PR source
The PR is created in the CI job