Skip to content

feat: stage a fast append, to write a chain of snapshots together - #5

Merged
hasyimibhar merged 1 commit into
polynya-patches-v0.10.1from
concurrent-manifest-writes
Oct 19, 2026
Merged

hasyimibhar merged 1 commit into
polynya-patches-v0.10.1from
concurrent-manifest-writes

Conversation

@hasyimibhar

Copy link
Copy Markdown

pg2iceberg commits several snapshots in one table update (a large transaction, or a materializer catching up): a chain of fast appends, each on the last. Each one wrote its manifests, then its manifest list, then read that list back for the next: four round trips to the object store per snapshot, one after another, and committing was the largest part of pg2iceberg's materializer time.

FastAppendAction::stage(table) plans the append's snapshot without writing it: the ActionCommit that adds it, and a StagedSnapshot holding its files to write.

  • write_manifests() writes its own manifests together and returns them as its manifest list records them, with its sequence number assigned, so a later snapshot's list can carry them (otherwise that list's writer refuses them: "Found unassigned sequence number for a manifest from snapshot ...").
  • write_manifest_list(manifests) writes the list naming the manifests the caller passes: its parent's, then its own.

A chain's manifests can then all be written at once, then all its lists. V1 and v2 only: a v3 snapshot's row range comes from the written list. SnapshotProducer::commit now shares the list writer and snapshot construction with stage.

Test: a chain of three appends (each a data and an equality-delete file), staged and written together, lands as the same table as the appends committed one by one: same snapshots, sequence numbers, summaries, and per-snapshot manifests and files.

In pg2iceberg's TPROC-C benchmark (S3 a request's latency away), a commit's time went from 679 ms to 354 ms on average.

🤖 Generated with Claude Code

A commit that chains several appends — each a snapshot on the last —
wrote each one's manifests, then its manifest list, then read that list
back for the next: four round trips to the object store a snapshot, one
after another.

`FastAppendAction::stage` plans the snapshot against the table without
writing it: the commit that adds it, and a `StagedSnapshot` holding its
files to write. `write_manifests` writes its own manifests together and
returns them as its manifest list records them (with its sequence
number); `write_manifest_list` writes the list naming the manifests the
caller passes — its parent's, then its own. A chain's manifests can then
all be written at once, and then all its lists. V1 and v2 tables only:
v3's row lineage takes its range from the written list.

`SnapshotProducer::commit` shares the list writer and the snapshot
construction with `stage`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@hasyimibhar
hasyimibhar merged commit 0ded76c into polynya-patches-v0.10.1 Oct 19, 2026
14 of 19 checks passed
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