Repository navigation
Add a mode to let toast stay in shadow pg - #163
Merged
Merged
Conversation
harshil-goel
force-pushed
the
harshil/toast-shadow
branch
3 times, most recently
from
September 17, 2026 14:44
03e6d01 to
1b6b5e0
Compare
serprex
reviewed
Sep 17, 2026
serprex
force-pushed
the
harshil/toast-shadow
branch
from
September 17, 2026 16:35
b0932a3 to
b6df08f
Compare
serprex
reviewed
Sep 17, 2026
serprex
reviewed
Sep 17, 2026
serprex
approved these changes
Sep 17, 2026
serprex
force-pushed
the
harshil/toast-shadow
branch
2 times, most recently
from
September 17, 2026 21:56
fa5d98f to
54db6b9
Compare
serprex
approved these changes
Sep 17, 2026
serprex
force-pushed
the
harshil/toast-shadow
branch
2 times, most recently
from
September 17, 2026 23:39
6c71638 to
67c2bc9
Compare
serprex
reviewed
Sep 18, 2026
serprex
force-pushed
the
harshil/toast-shadow
branch
5 times, most recently
from
September 20, 2026 16:50
e5451e1 to
72a3211
Compare
Shadow keeps physical TOAST heaps and indexes as it replays source WAL, so external values resolve through local index lookups instead of a ClickHouse chunk mirror. Select with `[toast] mode = "shadow"`. Disabled mode leaves external values unresolved, for destinations that do not want them pgext gains a fetch op. Its snapshot is built by hand rather than through get_toast_snapshot(): PG 18 exports SnapshotToastData, 16 and 17 have neither. All three agree on what the read needs, snapshot_type selects HeapTupleSatisfiesToast and a zeroed lsn/whenTaken disables the old-snapshot check PG 16 still carries
Raise default value cap to 1 GiB, reserve 64 MiB per decoder Size payload budget from cgroup or host memory Serialize decode requests exceeding reserve Fill oversized values with NULL or column defaults, allow error policy as opt-in config
…gnores Replay wait was short enough to trip on a busy shadow. TRUNCATE and rewrite barriers now no-op when the store rejects writes, instead of erroring
Restart could resume past shadow's replay position, leaving shadow without WAL it still needed, and the floor could release segments the same way ShadowFloor folds both bounds into one place: it binds only when shadow holds data, prefers the live replay position over the persisted seed, and aligns down to a segment. A pinned start (`--start-lsn`, bootstrap end) stays unbounded
…y through a record A WAL record can span two files. If walshadow already rewrote that record, restarting at file two could mix its rewritten beginning with its original ending On startup, walshadow now: - Looks for saved WAL in its output directory, then shadow PostgreSQL’s pg_wal directory - Checks whether resume position contains an unfinished record’s continuation - Loads that saved continuation, following it across pages and files if needed - Replaces incoming bytes for that continuation with saved bytes It also checks saved page addresses, continuation lengths, and incoming page headers, so inconsistent continuation data causes an error
Add an option to preserve and reconnect to a compatible running shadow, with systemd configuration for process-only restarts Prefetch archived WAL into memory and replay through normal checkpoint, pause and shutdown handling. Recovery reports through the shared metric collectors, adding fetch, replay and queue wait Honor configured object-store backfill concurrency
Limit memory held by ClickHouse insert batches Count allocated buffer capacity and share memory limits across pending batches and partial tables. Size batches by inserter count Allow oversized rows to progress and expose OS thread count as a metric
Backup counts run in parallel with copy
Compare chunk xmin with sampled xid ceilings to detect replacements, return fills for detected reuse and count them separately Reject opt-in and configured tables whose TOAST heaps shadow cannot serve, use configured TOAST store during backfill
serprex
force-pushed
the
harshil/toast-shadow
branch
from
September 21, 2026 14:14
fec6f87 to
abc3b2a
Compare
Amogh-Bharadwaj
approved these changes
Sep 21, 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.
No description provided.