Skip to content

ensure_future_partitions logs ERROR on a freshly migrated schema (overlap with the future partition) #2474

Description

@vsima

Environment

  • Relay: ghcr.io/block/buzz:sha-2d26db6 and sha-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_partitions should 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions