DB maintenance + health observability + Postgres integration CI lane #72
Reference in New Issue
Block a user
Delete Branch "dev"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Rolls up
devintomain. Headline of this batch is basic Postgres maintenance + the visibility to use it, plus a real-DB CI lane.Database maintenance (#838)
VACUUM (ANALYZE)over the six high-churn tables the retention/purge sweeps churn (app_logs,notifications, the token tables,notes,note_versions), complementing autovacuum.services/db_maintenance.pyruns over a closed allowlist via an AUTOCOMMIT connection (VACUUM can't run in a txn); per-table summary; one failure doesn't abort the rest.services/db_maintenance_scheduler.py: BackgroundScheduler, default 04:00 UTC (after the 03:30 trash purge); enable-gate at fire time; live reschedule on hour change.Table-health observability (#839)
get_table_health()overpg_stat_user_tables+ size functions: per-table size, live/dead tuples, dead-tuple ratio (the bloat signal), last (auto)vacuum/(auto)analyze, total DB size.Postgres integration CI lane
integrationjob (rules 6/79–82):postgres:16-alpineservice, bridge-IP discovery, busybox-safe readiness wait,alembic upgrade head,pytest -m integration. Unittestjob now runs-m "not integration".test_integration_db_maintenance.pyrunsrun_maintenance()/get_table_health()against real Postgres — the guard that catches the sync/async API class of bug unit mocks can't (an un-awaitedexecution_options, fixed here, that reported VACUUM 0/6).Also brings along any earlier
devwork not yet onmain. All CI-green ondevhead4f31890.🤖 Generated with Claude Code