Skip to content

Iceberg: reuse the Puffin object metadata across deletion-vector reads - #2419

Open
UnamedRus wants to merge 1 commit into
antalya-26.6from
puffin-dv-metadata-threading
Open

UnamedRus wants to merge 1 commit into
antalya-26.6from
puffin-dv-metadata-threading

Conversation

@UnamedRus

Copy link
Copy Markdown
Collaborator

Changelog category (leave one):

  • Performance Improvement

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

Reduce number of Puffin file HEAD requests

Documentation entry for user-facing changes

...

CI/CD Options

Exclude tests:

  • Fast test
  • Integration Tests
  • Stateless tests
  • Stateful tests
  • Unit tests
  • Performance tests
  • Aarch64 tests
  • All with ASAN
  • All with TSAN
  • All with MSAN
  • All with UBSAN
  • All with Coverage
  • All Regression
  • Disable CI Cache

Regression jobs to run:

  • Fast suites (mostly <1h)
  • Aggregate Functions (2h)
  • Alter (1.5h)
  • Benchmark (30m)
  • CAS (content-addressed storage; Antalya only)
  • ClickHouse Keeper (1h)
  • Iceberg (2h)
  • LDAP (1h)
  • OAuth (5m)
  • Parquet (1.5h)
  • RBAC (1.5h)
  • SSL Server (1h)
  • S3 (2h)
  • S3 Export (2h)
  • Swarms (30m)
  • Tiered Storage (2h)

Loading one deletion vector issued two or three S3 `HEAD` requests against the
same object. `loadDeletionVector` already calls `getObjectMetadata` for the
Puffin file to read its etag for the `PuffinFilesCache` key, but then passes
only the path down: `readFooterBlobs` and `loadDeletionVectorUncached` each
build a fresh `RelativePathWithMetadata` with empty metadata, and
`createReadBuffer` fills it in with another `getObjectMetadata` for every
buffer it opens.

Thread the already-fetched metadata into both helpers instead.
`createReadBuffer` issues its own request only when
`RelativePathWithMetadata::metadata` is empty, so seeding it removes the
redundant requests without changing which bytes are read. The two call sites
that run before the etag fetch keep passing `std::nullopt` and behave as
before.

On a lake scan with cold deletion vectors this is the dominant cost: a profile
of one such query recorded 5706 `S3HeadObject` requests against 2833
`PuffinFilesRead`, with about 94 seconds spent in `HEAD` alone.

Reusing a single metadata snapshot for every read of the same Puffin file is
also more coherent than re-fetching it. Iceberg data and delete files are
immutable, so the separate requests could only ever have observed the same
object.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Workflow [PR], commit [33aed19]

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant