Repository navigation
SS-492 - test: cover PostgreSQL exports progressing during a held snapshot - #39420
Conversation
1ebea0d to
d10417a
Compare
d10417a to
9f4ad43
Compare
9f4ad43 to
7e0ed94
Compare
7e0ed94 to
a1eba8f
Compare
a1eba8f to
8a9055a
Compare
8a9055a to
a4fe7e8
Compare
a4fe7e8 to
4ae0bb5
Compare
4ae0bb5 to
3be8385
Compare
QA LLM Review1. MEDIUM -- Release workflow passes when the held snapshot is re-run after a dataflow restart
DetailsThe pass-through path in today's code:
So a bug in exactly the path this workflow exists for, committing staged CDC once the held frontier lifts, surfaces as one restart followed by a green run. To make the claim checkable, assert something only the in-place path produces. For example, require that |
3be8385 to
ce752f0
Compare
ce752f0 to
aab90be
Compare
confirmed and fixed |
fd19975 to
2279d48
Compare
peterdukelarsen
left a comment
There was a problem hiding this comment.
Human-only-review... Looks to me like it tests the key functionality of letting CDC continue during snapshot of a new table.
| // deactivated. `return(<table name>:<millis>)` holds it for that long | ||
| // instead, so the snapshot completes in the same dataflow incarnation. | ||
| // Tables are snapshotted in OID order, so tables ordered before the paused | ||
| // one complete their snapshots. |
There was a problem hiding this comment.
nit: can we tuck this away in a function?
| Testdrive(no_reset=True, default_timeout="120s"), | ||
| Clusterd( | ||
| name="clusterd1", | ||
| environment_extra=["FAILPOINTS=pg_snapshot_pause=return(t_paused:30000)"], |
There was a problem hiding this comment.
Why did you choose 30s?
There was a problem hiding this comment.
guess - making it too long just makes the test take a long time, making it short would cause flake.
|
Not going to share anything from review with Claude-code. It of course found some issues, but nothing blocking IMO |
2279d48 to
a11ee92
Compare
Add a `pg_snapshot_pause` failpoint that holds one table's snapshot copy, and two test/cluster workflows built on it. `pg-snapshot-freshness` checks that a hydrated table keeps ingesting CDC while another table's snapshot is held, that a table added alongside completes its own snapshot, and that everything converges after a restart re-runs the snapshot. `pg-snapshot-freshness-release` lifts a timed hold within the same dataflow and checks that the snapshot and the CDC staged behind it land exactly once. Co-Authored-By: Claude <noreply@anthropic.com>
a11ee92 to
18c0c44
Compare
…pshot (#39419) ### Motivation Today a PostgreSQL source snapshots all of its tables before it reads any of the replication stream. This PR lets the replication operator read the stream while the snapshot runs. #39479 then lets each export's frontier advance on its own. ### Description All new behavior is keyed off `storage_persist_sink_description_lookahead` being nonzero. That dyncfg already controls whether the persist sink groups a snapshotting export's updates into one batch, and it defaults to zero in production and to 5s in mzcompose. Concurrent replication is what makes a snapshot accumulate many timestamps, and reading the stream concurrently without the grouping keeps one batch builder per timestamp resident until each reaches the blob target size. The two are therefore one setting rather than a separate flag. With a nonzero lookahead, the snapshot operator emits its rewind requests as soon as the snapshot LSN is known, before any table is copied. The replication operator then reads the stream while tables are copied. Every export still advances together, so replication data is staged in the dataflow until the snapshot completes. This trades cluster memory during hydration for progress on the replication stream. With the lookahead at zero, rewinds are emitted after the copy completes, as before. The snapshot operator reads the setting once, since the early and the late emission must not both happen or both be skipped. Only the snapshot operator reads it in this PR, so a change takes effect for snapshots that start afterwards. parallel-workload already rolls the lookahead through zero and nonzero values. The persist sink logs the resolved lookahead per export at dataflow build time, so a hydration's logs show whether grouping and concurrent replication are on. ### Verification The mzcompose default sets the lookahead to 5s, so the existing mzcompose-based PostgreSQL source tests exercise the early rewind path. #39420 adds targeted coverage. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude <noreply@anthropic.com>
…g a snapshot (#39479) ### Motivation Every export's frontier stays at the minimum until the last table's COPY finishes. Adding one large table to a source therefore still stalls ingestion for every table already hydrated in that source. ### Description With `storage_persist_sink_description_lookahead` nonzero, each export's port holds the minimum capability only while that export still has snapshot data to emit or a pending rewind. - Exports that are not being snapshotted drop their snapshot capabilities up front, so they advance with the replication stream. - A snapshotted export releases its snapshot capability as soon as its own copy finishes on each worker. - The replication operator downgrades every port without a pending rewind at each yield point. With the lookahead at zero, all ports advance together, so behavior matches #39419. The replication operator now reads the setting as well. The two operators read it independently at startup, and parallel-workload rolls the lookahead through zero and nonzero values, so a change can land between those two reads and leave the operators in different modes within one dataflow. That is benign in both directions. With only the snapshot operator concurrent, the replication operator holds every port until the rewinds resolve and then releases them all. With only the replication operator concurrent, it still waits for the rewind input to close, which the serial snapshot operator does after the copy. ### Verification The mzcompose default sets the lookahead, so the existing mzcompose-based PostgreSQL source tests exercise per-export progress. #39420 adds targeted coverage. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude <noreply@anthropic.com>
Motivation
Adds targeted coverage for the concurrent replication behavior in PostgreSQL source.
Description
Adds a
pg_snapshot_pausefailpoint to the PostgreSQL snapshot operator.return(<table>)holds that table's copy until the failpoint is deactivated.return(<table>:<millis>)holds it for a fixed time, so the snapshot completes in the same dataflow incarnation. Tables are copied in OID order, so tables ordered before the held one finish their snapshots.Two new
test/clusterworkflows share setup and add-tables phases intest/cluster/pg-snapshot-freshness/.pg-snapshot-freshnessholdst_pausedindefinitely. It checks that an already hydrated table keeps ingesting CDC and thatt_alongside, added in the same transaction, completes its own snapshot. It also checks that CDC for the held table is staged without committing. It then restartsclusterdwithout the failpoint and checks that every table converges, with the row inserted during the hold appearing exactly once.pg-snapshot-freshness-releaseholdst_pausedfor 30 seconds while CDC for it arrives across several timestamps. It checks that when the hold lifts, the snapshot and all staged CDC commit exactly once without a restart, and that later CDC lands as for any hydrated table.Verification
Both workflows are new in this PR and rely on the mzcompose default that sets
storage_persist_sink_description_lookahead, which is what turns concurrent replication on.🤖 Generated with Claude Code