`ensure_future_partitions` logs ERROR on a freshly migrated schema (overlap with the future partition)
Environment
- Relay:
ghcr.io/block/buzz:sha-2d26db6andsha-acfbb1b(both) - Fresh, empty Postgres 16;
BUZZ_AUTO_MIGRATE=true; migrations complete successfully
What happens
Immediately after a clean migrate, every startup logs:
INFO Database migrations complete
ERROR Failed to ensure partitions: database error: error returned from database: partition "events_2026_07" would overlap partition "events_p_futu…" at line 437
(the partition name is truncated in our log capture — presumably
events_p_future.)
Non-fatal — the relay continues and events flow (presumably landing in the catch-all/future partition) — but it's ERROR-level on every boot of a pristine deployment, which (a) trains operators to ignore ERRORs and (b) suggests the monthly partition for the current month is never actually created when the default/future partition already covers the range.
Ask
- If the overlap is expected when a future/catch-all partition exists,
ensure_future_partitionsshould detach/split rather than blind-create, or skip with an INFO. - If monthly partitions are supposed to win over the catch-all, this is a real bug: current-month data is accumulating in the catch-all instead.
Can provide \d+ events output from a fresh deployment on request.
Fixed in https://github.com/block/buzz/pull/ — overlap against *_p_future no longer requires SQLSTATE 42P17 to be treated as ensured.
Fixed in https://github.com/block/buzz/pull/2505 — overlap against *_p_future no longer requires SQLSTATE 42P17 to be treated as ensured.
Confirming this on a live deployment, with the data-side consequence made explicit.
Fresh Postgres 17, BUZZ_AUTO_MIGRATE=true, ghcr.io/block/buzz:main, first boot in July 2026. The partition set stops at June:
events_p_past
events_p2026_01 … events_p2026_06
events_p_future
So this is not only log noise. Every event written by the deployment today — messages, reactions, git events, the lot — lands in the events_p_future catch-all, exactly as this issue predicted. p_future becomes the hot partition and stays that way for as long as ensure_future_partitions keeps failing, which on a fresh schema is every boot.
Low impact at our volume and easy to repair by hand, but for anyone standing up a relay now it means the partitioning scheme is effectively off from day one while the logs say ERROR and the relay says healthy.
Confirmed — this matches #2396. The durable fix is the catch-all roll-forward in #2456 (creates real monthly partitions instead of leaving writes in *_p_future). #2505 only quiets the overlap ERROR and does not repair the layout.