Skip to content

DataLakeCatalog: cache resolved table storages - #115873

Closed
adonm wants to merge 6 commits into
ClickHouse:masterfrom
adonm:adonm/datalake-catalog-storage-cache
Closed

adonm wants to merge 6 commits into
ClickHouse:masterfrom
adonm:adonm/datalake-catalog-storage-cache

Conversation

@adonm

@adonm adonm commented Aug 21, 2026 •

Copy link
Copy Markdown

Related: #116235

Reuse resolved DataLakeCatalog table storages within an explicitly enabled staleness window. catalog_cache_staleness_ms now defaults to 0, preserving uncached behavior unless an operator opts in. Keys separate execution modes, and entries retain their construction-time settings version so a late cache fill cannot be reused with newer database settings.

Added an integration check for invalidation after an auth-header change. Exact-head build and selected tests are queued: https://github.com/adonm/ClickHouse/actions/runs/33951076916. This is not yet evidence that TTL, concurrent invalidation, or every credential/refresh path is correct; those remain review work before undrafting.

Kept draft behind the shared-footer PR. Combined-branch benchmark results in the umbrella issue are exploratory and are not isolated attribution for this change.

Changelog category (leave one):

  • Performance Improvement

Changelog entry:

Add opt-in caching of resolved DataLakeCatalog table storages, with a configurable staleness window and explicit invalidation.


Original implementation assisted by DeepSeek V4 Pro; follow-up revisions also used AI assistance.

@CLAassistant

CLAassistant commented Aug 21, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@rienath rienath left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@adonm

adonm commented Aug 25, 2026

Copy link
Copy Markdown
Author

@rienath thanks for the feedback. I've moved the full context into #116235 (measurements, repro, landing order).

This PR is the DataLakeCatalog piece, second in that order. The one design point to flag: cacheable storages switch to eager init to close a first-use race on the shared DataLakeConfiguration metadata.

I'll rebase all six onto master and update here once fork validation is green.

adonm added 2 commits August 25, 2026 05:46
Keep the DataLakeCatalog storage cache current with master.
CREATE DATABASE with DataLakeCatalog connects to the catalog eagerly on
current master, so the stateless test cannot use an unreachable catalog
URL. Validate the new settings via clickhouse-format and keep SYSTEM
CLEAR idempotency; the cache behavior is covered by the integration test
test_catalog_cache_concurrent_first_use.
@scanhex12 scanhex12 self-assigned this Aug 25, 2026
@adonm
adonm marked this pull request as draft August 25, 2026 18:20
adonm added a commit to adonm/ClickHouse that referenced this pull request Sep 3, 2026
Replace debug-only `chassert` guards in `ManifestFilesPruner::partitionFilterHash` with real `LOGICAL_ERROR` checks on the `KeyCondition` `RPN` (`AND`/`OR`/`NOT`), so a malformed stack throws an exception in release builds instead of causing undefined behavior.

Document only, no behavior change: stateless `ManifestFileIterator::create` `table_snapshot_id` placeholder, `ParquetV3BlockInputFormat` row-group key unambiguity via `path.size()`, partition-only candidate sharing between data and delete iterators, derived `StorageInMemoryMetadata` `TableStateSnapshot` equality safety under `SYSTEM CLEAR ICEBERG METADATA CACHE`, and `DatabaseDataLake::tryGetTableImpl` global-context credentials, TTL race, and `ALTER DATABASE` over-invalidation.

Related: ClickHouse#116235
Related: ClickHouse#115873
Related: ClickHouse#115874
Related: ClickHouse#115876
Related: ClickHouse#115877
Related: ClickHouse#115878
@clickhouse-gh clickhouse-gh Bot added the comp-datalake Data lake table formats (Iceberg/Delta/Hudi) integration. label Sep 4, 2026
…ions

Preserve uncached freshness by default. Retain the settings version used to construct each cache entry so a loader finishing after `ALTER DATABASE` cannot serve that storage to queries using new settings. Use a monotonic TTL clock and add an integration check for invalidation after an auth-header change. Patched-binary testing is pending.
@maxknv maxknv added the external Author is not a member of the ClickHouse organization label Nov 2, 2026
@adonm

adonm commented Nov 9, 2026

Copy link
Copy Markdown
Author

Closing this draft to keep the review queue clear, per @rienath's request in #116235 to not have the whole series open at once.

The design notes and measurements remain in #116235. Nothing here is being pursued right now; if the team wants catalog-resolved storage caching separately, I'd rather open a fresh focused PR than revive this branch. Happy to do that if useful.

@adonm adonm closed this Nov 9, 2026
@clickhouse-gh clickhouse-gh Bot added comp-datalake-catalogs Data lake catalogs: the DataLakeCatalog database engine and its catalog clients - Iceberg REST, A... and removed comp-datalake Data lake table formats (Iceberg/Delta/Hudi) integration. labels Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

close in a month if not active This will be closed in case of no information comp-datalake-catalogs Data lake catalogs: the DataLakeCatalog database engine and its catalog clients - Iceberg REST, A... external Author is not a member of the ClickHouse organization

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants