Repository navigation
feat: stage a fast append, to write a chain of snapshots together - #5
Merged
Merged
Conversation
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>
This was referenced Nov 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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: theActionCommitthat adds it, and aStagedSnapshotholding 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::commitnow shares the list writer and snapshot construction withstage.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