Skip to content

Cache parsed Iceberg deletion vectors from Puffin files. - #122899

Open
ianton-ru wants to merge 2 commits into
ClickHouse:masterfrom
ianton-ru:puffin-files-cache
Open

ianton-ru wants to merge 2 commits into
ClickHouse:masterfrom
ianton-ru:puffin-files-cache

Conversation

@ianton-ru

@ianton-ru ianton-ru commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

A process-global Puffin files cache stores parsed Iceberg deletion-vector bitmaps so a repeated read of the same blob does not fetch and decode it again.

readIcebergDeletionVector looks up the blob before reading it. The key is the storage identity (getName, getDescription, namespace, and key prefix), path, strong etag, content offset, and content size. Weak or empty etags are not keys (isEtagUsableAsCacheKey), so those blobs are always read. The cache returns a clone, so a caller cannot mutate the stored bitmap. CacheBase::getOrSetWithOutcome classifies the hit or miss together with the value, so a concurrent SYSTEM DROP PUFFIN FILES CACHE is not reported as a hit.

use_puffin_files_cache enables the cache (default on). Server settings puffin_files_cache_policy, puffin_files_cache_size, puffin_files_cache_max_entries, and puffin_files_cache_size_ratio bound it. SYSTEM DROP PUFFIN FILES CACHE clears it and is gated by access control.

This is the Puffin files cache split out of #113561. Deletion-vector read support from that pull request landed separately in #110781. The merged reader seeks to the deletion-vector slice and does not parse Puffin footers, so this cache does not memoize footers and does not put the referenced data file or expected cardinality into the key.

Related: #113561
Related: #110781

Changelog category (leave one):

  • Performance Improvement

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

Cache parsed Iceberg deletion vectors loaded from Puffin files. A repeated read of the same blob, identified by storage, path, strong etag, offset, and size, reuses a cloned bitmap. Weak or empty etags are not cached. SYSTEM DROP PUFFIN FILES CACHE clears the cache.


Workflow [PR]
Sync PR [sync-upstream/pr/122899]

Repeated reads of the same blob reuse a cloned bitmap keyed by storage identity, path, strong etag, offset, and size. Weak or empty etags are not cached. `SYSTEM DROP PUFFIN FILES CACHE` clears the cache.

https: //github.com/ClickHouse/pull/113561
Co-authored-by: Cursor <[email protected]>
@clickhouse-gh clickhouse-gh Bot added the comp-datalake Data lake table formats (Iceberg/Delta/Hudi) integration. label Sep 29, 2026
@ianton-ru
ianton-ru marked this pull request as ready for review September 29, 2026 16:25
@clickhouse-gh clickhouse-gh Bot added the external Author is not a member of the ClickHouse organization label Sep 30, 2026
@scanhex12 scanhex12 self-assigned this Oct 31, 2026
extern const ServerSettingsUInt64 parquet_metadata_cache_size;
extern const ServerSettingsUInt64 parquet_metadata_cache_max_entries;
extern const ServerSettingsDouble parquet_metadata_cache_size_ratio;
extern const ServerSettingsString puffin_files_cache_policy;

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.

I think it makes sense to do the same cache for position deletes and put it into bitmaps

@alexey-milovidov alexey-milovidov added the can be tested Allows running workflows for external contributors label Nov 14, 2026
@clickhouse-gh

clickhouse-gh Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [c2fd7f7]

Summary: ❌

job_name test_name status info comment
Style check FAIL
settings_changes_history FAIL cidb
cpp FAIL cidb
Fast test FAIL
01271_show_privileges FAIL cidb
Code Review DROPPED
Build (amd_debug) DROPPED
Build (amd_asan_ubsan) DROPPED
Build (amd_tsan) DROPPED
Build (amd_msan) DROPPED
Build (amd_binary) DROPPED
Build (arm_debug) DROPPED
Build (arm_asan_ubsan) DROPPED

@clickhouse-gh clickhouse-gh Bot added pr-performance Pull request with some performance improvements comp-iceberg Apache Iceberg tables: reading and writing Iceberg metadata (snapshots, manifests, schema evoluti... and removed comp-datalake Data lake table formats (Iceberg/Delta/Hudi) integration. labels Nov 14, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors comp-iceberg Apache Iceberg tables: reading and writing Iceberg metadata (snapshots, manifests, schema evoluti... external Author is not a member of the ClickHouse organization pr-performance Pull request with some performance improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants