block / block/buzz

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

Open
#2,474 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
32.7k
Forks
4.3k
Avg merge
1d 13h
Merged PRs (30d)
253

Description

## 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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.