Repository navigation
Cherry pick #108674 to 26.4: Do not validate DataLakeCatalog auth_header or build catalog on ATTACH - #108793
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
…ypick/26.4/108674 # Conflicts: # src/Databases/DataLake/DatabaseDataLake.cpp # src/Databases/DataLake/DatabaseDataLake.h
|
Resolved the cherry-pick conflicts by merging Why the backport is smaller than the original #108674The original PR did three things on
On 26.4, item (1) is already the behavior: the constructor only calls What 26.4 actually needed, and what this backport contains, is items (2) and (3):
Test trace on 26.4
Original PR: #108674 |
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