Repository navigation
Do not block startup on an unreachable DataLakeCatalog catalog replayed from stored metadata - #132097
Conversation
…nition A catalog of databases replicated through a coordination service (as in ClickHouse Cloud) rebuilds `DataLakeCatalog` databases at startup with a plain `CREATE` query from the stored definition. That query is neither `ATTACH` nor a restore, so `DatabaseDataLake` built its catalog eagerly in the constructor. For an S3 Tables catalog this performs STS `AssumeRole` and a signed config request; when the IAM role is missing, the error aborted the whole replay, which was retried forever and blocked server startup. Treat a context marked with `isRecoveryFromStoredMetadata` as an existing definition: defer catalog construction to the first use, so the database is attached and reports the error on queries instead. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Workflow [PR], commit [7544ff1] Summary: ✅
AI ReviewSummaryReviewed #132097 at Missing context / blind spots
Final VerdictStatus: ✅ Approve |
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Compile time of recompiled translation units7 translation units recompiled, 17 s compile time in total, 7 of them have a recent master baseline. |
AI review of a later commit does not approve the PR, see the AI Review comment.
|
🕵 Merged |
…og` when replaying stored metadata The `auth_header` check, the `allow_database_*` gates, and the strict settings parsing in `loadFromQuery` ran before the recovery predicate, so a previously valid definition replayed as `CREATE` with `isRecoveryFromStoredMetadata` could still throw and block startup. Compute the predicate first and treat such a replay like `ATTACH` everywhere. A forbidden header is still never sent: `RestCatalog::validateAuthHeaders` rejects it before the first request. Co-Authored-By: Claude Opus 5.5 <[email protected]>
# Conflicts: # src/Databases/DataLake/DatabaseDataLake.cpp
|
🕵 @groeneai, investigate the failure: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=132097&sha=97f0990894d718fa899eb129bf01588b45c5ccd9&name_0=PR&name_1=Performance%20Comparison%20%28arm_release%2C%20master_head%2C%20iceberg_s3%2C%202%2F3%29 and provide a fix in a separate PR. If the fix is already in progress, link it here. The reference ( I also merged |
|
Both parts are already fixed in open PRs, and the server was not OOM-killed:
|
|
🕵 Thanks, @groeneai: the ARM perf death is tracked by #132186 and the missing report by #132710, so nothing to do here. CI at |
Conflicts with the replayed-definition flag of ClickHouse#115581 and the `DataLakeCatalog` replay rules of ClickHouse#132097: - `TableFunctionFactory::get` and `getRequiredAccessOfTableFunction` take both `is_replayed_definition` and the loading `mode`; the data lake argument check of a table function keys on the mode, like the engine path, so a stored `CREATE TABLE ... AS <data lake function>` still loads wherever master now parses the function for the access check. - `DatabaseDataLake::table_definition_mode` treats a replay marked with `isRecoveryFromStoredMetadata` as `ATTACH`, as ClickHouse#132097 does for the other fresh-`CREATE` validations. - Glue catalog: `SecretString` engine definition from master, plus the mode. - Docs and `.syntax` strings: master's workload identity forms of `deltaLakeAzure`, `deltaLakeAzureCluster` and `DeltaLakeAzure` without the `compression` slot. Co-Authored-By: Claude Opus 5.5 <[email protected]>
A
DataLakeCatalogdatabase (for example,catalog_type = 's3tables') whose IAM role was deleted could block server startup.DatabaseDataLakealready defers catalog construction forATTACHandRESTORE, so a plain server restart from local metadata is fine. A catalog of databases replicated through a coordination service, as in ClickHouse Cloud, replays the stored definition as a plainCREATEinstead. That query is neitherATTACHnor a restore, so the constructor built the catalog eagerly. For S3 Tables, building the catalog calls STSAssumeRoleand sends a signed config request. With the role missing, the error is notACCESS_DENIEDand was rethrown. That aborted the whole replay, which retried forever, so startup never finished.With this change, a query context marked with
isRecoveryFromStoredMetadatacounts as an existing definition. That flag is already used forCREATEqueries replayed from stored metadata byReplicateddatabase recovery andSYSTEM RESTART REPLICA. The catalog is built on first use, so the database attaches and the error is reported on queries against it. A userCREATE DATABASEstill builds the catalog eagerly and fails immediately on misconfiguration. The replaying side sets the flag on its query context in a companion change in the private repository.No test is added: public code has no path that creates a database from stored metadata as
CREATE, and a stateless test cannot set this context flag.Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
A
DataLakeCatalogdatabase whose catalog is unreachable or unauthorized (for example, an S3 Tables catalog with a deleted IAM role) no longer blocks server startup when its definition is replayed from stored metadata; the error is reported on queries to the database instead.🤖 Generated with Claude Code
Workflow [PR]
Sync PR [sync-upstream/pr/132097]
Version info
26.12.1.24-master(included in26.12and later)