You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
An interrupted backfill leaves rows in an unattached partition; plan / validate report ok #76
Backfill moves a window's rows into a new table, then attaches it. If the process is killed in between, the rows sit in a table that isn't attached and reads through the parent don't see them. Killing backfill mid-window left 5,000 rows in an unattached events__2026_05; plan and validate both reported ok. Re-running backfill recovered them with nothing lost or duplicated.
Suggestion: have plan / validate flag tables that match the partition naming, aren't attached, and hold rows, and point at re-running backfill.
Heads-up: I found this while testing pg-partsmith against Outpost's schema with a fair amount of LLM help. I reproduced it myself, but haven't dug deep, so treat it as a report rather than a requirement; your call on whether and how to fix it.
Fixed in 1.7.0 (#85). What your run left behind now shows up in plan:
[warning] unattached_rows: public.events__2026_05 holds rows of 2026_05 but is attached to nothing, so no query through public.events sees them; backfill (partition_data) attaches it.
It's a warning, so plan --check exits 3 on it. And backfill finishes the job itself: once DEFAULT has nothing left to move, it attaches such a table the same way it attaches a window it has just filled. So re-running it is still the fix, it just no longer depends on DEFAULT still holding rows of that month.
Only a table named exactly what the scheme gives a window under that root counts, so events_remote__2026_05 next to events isn't taken for May and its rows are never read. A table with a window's name but rows outside that window wasn't left by a backfill; backfill says so and leaves it alone.
validate stays a check of the config against the catalog (method, key, unique constraints) and doesn't read data, so the report went into plan.
Checked on a reproduction of your case: killed between the fill and the attach, 0 of 744 rows visible through the parent, the warning in plan, then backfill attached the table, all 744 visible and the warning gone.
Thanks for all four of these, by the way. Each one turned into a real fix.
Activity
fix: a backfill that cannot attach gives the rows back to DEFAULT
fix: a backfill that cannot attach gives the rows back to DEFAULT (#83)
feat: find and attach the partitions a stopped backfill left unattached
feat: find and attach the partitions a stopped backfill left unattached
AlexeyShalaev commentedon Sep 29, 2026
Fixed in 1.7.0 (#85). What your run left behind now shows up in
plan:It's a warning, so
plan --checkexits 3 on it. Andbackfillfinishes the job itself: once DEFAULT has nothing left to move, it attaches such a table the same way it attaches a window it has just filled. So re-running it is still the fix, it just no longer depends on DEFAULT still holding rows of that month.Only a table named exactly what the scheme gives a window under that root counts, so
events_remote__2026_05next toeventsisn't taken for May and its rows are never read. A table with a window's name but rows outside that window wasn't left by a backfill;backfillsays so and leaves it alone.validatestays a check of the config against the catalog (method, key, unique constraints) and doesn't read data, so the report went intoplan.Checked on a reproduction of your case: killed between the fill and the attach, 0 of 744 rows visible through the parent, the warning in
plan, thenbackfillattached the table, all 744 visible and the warning gone.Thanks for all four of these, by the way. Each one turned into a real fix.