mirror of
https://github.com/block/buzz.git
synced 2026-10-29 05:21:31 +00:00
The repaired events and delivery_log catalogs end in an empty catch-all
from 2027-01-01 that the merged manager only audits. Add opt-in
maintenance (BUZZ_PARTITION_MANAGER_ADVANCE_ENABLED, default false) that
keeps six dedicated monthlies after the current month by replacing the
empty catch-all with canonical monthlies and a later <table>_p_future,
at startup and on every audit interval.
Each table's change runs in one transaction that takes a schema-scoped
advisory lock (losers report skipped_locked), locks foreign-key
counterparts ACCESS EXCLUSIVE NOWAIT in OID order before ONLY the parent
under a 2s lock_timeout and the catch-all NOWAIT, re-plans from a
locked re-audit, and verifies bounds, trigger parity, and index and
constraint inheritance before commit. Statement, idle-in-transaction,
and a 10s client deadline bound every attempt; a deadline-abandoned
connection is closed rather than pooled. A populated catch-all,
misaligned bound, unsafe catalog, or name collision is refused as
operator_required before any lock.
Uncovered-month creation now uses the same locked path. The relay and
buzz-admin audit horizon becomes six months, and maintenance outcomes
are exported as buzz_partition_maintenance_runs_total{table,outcome}.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Ian Oberst <ioberst@block.xyz>