Repository navigation
Conversation
After the mid-copy kill, writes made during the outage could all land above the copy's saved watermark, where the resumed copy carries them, so the claim that the kept slot carries outage writes went unchecked.
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
🤖 Review 1/2 (correctness) of f281c08: 0 blocking, 3 non-blocking. Inspected the whole change at The question I asked first is whether the new assertion can pass vacuously. It cannot do so in a way that matters. The claim it adds is sound against the repo's own rule: a resumed copy deletes every shadow row above the saved watermark and copies the table above it again, so a write above the watermark reaches the new table without the slot, and only a write at or below it needs the kept slot (CO-4, Invariants ( Non-blocking
Test case (not run here): needs a PostgreSQL container, which this review does not startfunc TestWriteAtOrBelowUpdatesTheHighestKeyAndDeletesTheNext(t *testing.T) {
dsn := testutil.StartPostgres(t)
pool, err := pgxpool.New(t.Context(), dsn)
require.NoError(t, err)
t.Cleanup(pool.Close)
table := testutil.NewWorkloadTable(t, pool)
require.NoError(t, table.SeedRows(t.Context(), 10))
written, err := writeAtOrBelow(t.Context(), pool, table, 6)
require.NoError(t, err)
assert.Equal(t, []int64{6, 5}, written)
var label string
require.NoError(t, pool.QueryRow(t.Context(), `SELECT label FROM `+table.Qualified()+` WHERE id = 6`).Scan(&label))
assert.Equal(t, "row-6o", label)
var present int
require.NoError(t, pool.QueryRow(t.Context(), `SELECT count(*) FROM `+table.Qualified()+` WHERE id IN (4, 5, 7, 10)`).Scan(&present))
assert.Equal(t, 3, present, "key 5 is deleted; keys 4, 7 and 10 are untouched")
}Written against the seeding in
Verified
This review was generated by Claude Code (claude-sonnet-5-5). |
|
🤖 Review 2/2 (OSS adoption and integration) of f281c08: 0 blocking, 3 non-blocking. Read the change from two seats: an importer who wants the same proof for their own host (SchemaBot is the obvious one, driving Non-blocking
What reads well for adopters
This review was generated by Claude Code (claude-sonnet-5-5). |
aparajon
left a comment
There was a problem hiding this comment.
🤖 Stamping with comments: 0 blocking, 6 non-blocking (see the review comments above).
This stamp was left by Claude Code (claude-sonnet-5-5).
The kill proof now makes and requires at least one write during the outage that only the kept replication slot can carry.
Why
The kill proof kills pg-sprite in the middle of a copy, keeps writing to the table while it is down, then resumes and checks that the result matches. It is meant to show that the replication slot pg-sprite keeps across the crash carries those outage writes. But a write to a row the copy has not reached yet is picked up by the resumed copy itself, so if every outage write landed there, the proof passed without the slot carrying anything.
What
WatermarkAtKill) and updates one existing row and deletes another at or below it, so the slot must carry them; the load's own random writes continue as before.checkOutageWritesAtOrBelow, a pure function with its own unit test). The count is recorded asoutage_writes_at_or_below_watermark.docs/testing.md: the kill proof section, its "a pass proves" list and the record fields.make load-proof-killpasses at 20,000 rows: run 1 was killed in copying at watermark 1012, and 9 outage writes landed at or below it.Before / after
The same kill, at watermark 1012 of a 20,000-row table. Before, the proof could pass with every outage write above 1012, where the resumed copy carries it; after, at least one write at or below 1012 is required, and only the slot can carry that one.