Repository navigation
Description
Key: SPR-15 · Type: HITL · Part of: #327 · Blocked by: #325 reads posted; the #325 and #324 7-day windows ended; #755 is done: built (fbff54d6d), pushed 2026-11-12, clean 24 h GlitchTip read 2026-11-13, released in v2.3.6. The #323 hour is done (2026-11-07). · Checked against: 0b302b2
Problem
Prod Postgres runs image supabase-postgres-15.8.1.073, and the Supabase security linter flags it as vulnerable_postgres_version (WARN). The image misses later Supabase security patches. Severity is MEDIUM (OWASP A06:2021, vulnerable and outdated components).
This is the Supabase project database. The collab database is separate and already runs PostgreSQL 18.6.
This is patch debt, not a known open path. Most Postgres CVEs need a SQL session. The browser roles reach SQL only through PostgREST, which lowers the risk. The grant and RLS gaps in #314 and the pg_net drop in #321 came first, and both are closed.
The upgrade takes the whole Supabase project offline, including Auth. During that time, sign-in, chat, push, email and document-view processing stop. So it needs a rehearsal, a planned window, and a fixed list of checks before and after.
While Auth is offline, signed-in editors who reconnect join as anonymous, and owners cannot open Private pads. Pad text saves to the collab database and should keep saving.
Benchmark
| Field | Value |
|---|---|
| Metric | Supabase outage seconds in the upgrade window: count of 30 s blackbox samples where probe_success on /health/supabase is 0, times 30 s |
| Before | n/a: no upgrade has run. Server version 15.8, image 15.8.1.073, read 2026-11-10 (ruling comment of 2026-11-10). |
| After | not measured yet |
| Condition | Supabase production project, Small compute (confirm on the Infrastructure page), eu-west-2. Record the window date, the UTC start and end, and the target image tag. Prometheus keeps 15 days (45 after #749), so read the outage within that time. |
| How to run | At the window end, in Grafana Explore: count_over_time((probe_success{job="blackbox", instance=~".*/health/supabase"} == 0)[3h:30s]) * 30. Set the range to cover the whole window. |
| Pass rule | 3,600 s or less. Record the real value. If chat, Auth or any sub-hourly cron job still fails 60 minutes after the upgrade ends, restore the pre-upgrade backup (step 7b). |
| Guard | 0 of 5 chat messages lost in the window (step 6). Pad text survives a Supabase outage on the local stack (step 3b). A signed-in owner opens a Private pad after the upgrade (step 7). |
| Owner | maintainer: steps 1, 1b, 2, 4-7 and 7b. agent in the repo: steps 3, 3b and 8. |
| Claim | "We moved the docs.plus Supabase database from Postgres 15.8 to 17 with N minutes of planned downtime. 0 chat messages were lost, and all 12 cron jobs and 4 queues came back." |
Other measures for this window:
| Metric | Before (date, method) | After plan | Method | n |
|---|---|---|---|---|
show server_version |
15.8 (image 15.8.1.073, 2026-11-10) | 17.x, image tag written here | SQL editor | exact |
Linter vulnerable_postgres_version rows |
1 (2026-09-28) | 0 | Advisors > Security | exact |
| Linter ERROR rows | 0 (2026-11-03) | 0 | Advisors > Security | exact |
check-grants.sql rows |
0 (2026-11-03) | 0 | packages/supabase/scripts/check-grants.sql |
exact |
| Upgrade minutes, copy rehearsal | n/a | record | step 4 start and end, UTC | exact |
| Restore minutes, copy to pre-upgrade backup | n/a | record | step 4 | exact |
| Chat messages lost when sent in the window | n/a | 0 of 5 | scratch pad, step 6 | 5 |
| Pad text lost in the local Supabase outage | n/a | 0 of 2 browsers | step 3b | 2 |
Cron jobs active; sub-hourly jobs succeeded within 1 h |
12 of 12 (step 1) | 12 of 12; every sub-hourly job succeeded | step 1 and step 7 SQL | exact |
pgmq queues; worst oldest_msg_age_sec 15 min after |
4 (step 1) | 4; NULL or < 300 | pgmq.metrics_all() |
exact |
| Email and push dead-letter entries | step 1 value | same as step 1 | queue_jobs{queue=~"email-notifications-dlq|push-notifications-dlq", state="waiting"} |
exact |
realtime.list_changes mean ms per call, one hour |
step 1b snapshot pair (lifetime mean 4.84 ms, 2026-09-28) | step 7 pair, 24 h after; within 20 % | pg_stat_statements delta, #323 method |
one window, about 8,000 calls |
get_cron_job_health mean ms per call, one hour |
32.4 ms (2026-11-07, 40 calls, #323) | step 7 pair; within 20 % | same | one window, about 40 calls |
Context
Labels: [prod] = read on prod, read-only, 2026-09-28, before the no-agent rule. [local] = local Docker stack, same image. [repo] = this tree. [docs] = Supabase upgrade page, read 2026-09-28. [pred] = predicted, not measured.
Prod facts
| Fact | Value | Source |
|---|---|---|
| Image | supabase-postgres-15.8.1.073, region eu-west-2 |
[prod] linter and project info |
| Database size | 62 MB | [prod] pg_database_size |
| Compute | Small, inferred (2 GB RAM, 2 shared cores) | [prod] inferred |
cron.job_run_details |
25,898 live rows, 18 MB | [prod] |
| Replication slots | supabase_realtime_replication_slot_... (wal2json, active) and supabase_realtime_messages_replication_slot_... (pgoutput, active), on 2026-09-28. On 2026-10-25 the slot stats read returned 0 rows, because no chat subscriber held a slot (#325). |
[prod] |
Publication supabase_realtime |
Repo publishes channels, messages, channel_members, channel_message_counts. Prod may also hold email_queue. Step 1 records the full list. |
[repo], [prod] |
| Event triggers | issue_pg_net_access, issue_pg_graphql_access, issue_graphql_placeholder, pgrst_ddl_watch, pgrst_drop_watch, issue_pg_cron_access, ensure_rls (calls rls_auto_enable) |
[prod] |
max_connections |
90; 27 in use at the sample time | [prod] |
Extension versions. These are the local versions: pg_cron 1.6, pgmq 1.4.4, pg_net 0.14.0, pgjwt 0.2.0, pg_graphql 1.5.11, supabase_vault 0.3.1 [local]. Prod runs the same image, but nobody has read prod's pg_extension yet. Step 1 does that.
The 12 cron jobs (all ran with no failures, 2026-09-21..28) [prod]:
| Job id | Name | Schedule | Repo home |
|---|---|---|---|
| 2 | update-user-status |
every 2 min | packages/supabase/scripts/16-cron-jobs.sql ~8 |
| 17 | cleanup-push-subscriptions |
every 5 min | 16-cron-jobs.sql ~20 |
| 29 | cleanup-orphan-chat-media |
daily 03:30 | 16-cron-jobs.sql ~28 |
| 37 | cleanup-cron-job-run-details |
daily 04:15 | 16-cron-jobs.sql ~41 |
| 28 | message_counter_batch_job |
every minute | 09-message_counter.sql ~261 |
| 31 | process_document_views_queue |
every 10 min | 09-document-views.sql ~872 |
| 8 | aggregate_document_view_stats |
every 5 min | 09-document-views.sql ~885 |
| 9 | create_document_views_partitions |
monthly (1st, 00:05 UTC) | 09-document-views.sql ~898 |
| 10 | cleanup_old_document_views |
weekly (Sunday 03:00) | 09-document-views.sql ~911 |
| 25 | process_email_queue |
every 2 min | 07-5-email-notifications-pgmq.sql ~798 |
| 26 | compile_digest_emails |
every 15 min | 07-5-email-notifications-pgmq.sql ~811 |
| 27 | cleanup_email_queue |
daily 03:00 | 07-5-email-notifications-pgmq.sql ~847 |
The four pgmq queues [repo]: push_notifications (07-4-push-notifications-pgmq.sql ~36), email_notifications_queue (07-5-email-notifications-pgmq.sql ~83, non-partitioned), message_counter (09-message_counter.sql ~71), document_views (09-document-views.sql ~252). The repo calls only pgmq.send, read, archive, delete, create, create_non_partitioned and metrics_all. public.get_pgmq_queue_metrics (07-4-push-notifications-pgmq.sql ~606) selects metrics_all() columns by name, so a new column in a newer pgmq does not break it [repo]. The scripts also touch pgmq internals. They declare pgmq.message_record variables (09-message_counter.sql ~167, 09-document-views.sql ~355). They read queue tables directly: pgmq.q_push_notifications and pgmq.a_push_notifications (07-4-push-notifications-pgmq.sql ~433-439), and pgmq.q_email_notifications_queue (07-5-email-notifications-pgmq.sql ~874). A newer pgmq may change those shapes [pred]. Step 3 rebuilds them on the new image.
What the Supabase upgrade page says [docs] (https://supabase.com/docs/guides/platform/upgrading):
- Start it with the "Upgrade project" button on the project's General settings page. The security report named Settings > Infrastructure. Use whichever page shows the button. That page also shows a time estimate.
- The upgrade uses
pg_upgrade. "Your project is taken offline", and a new instance is created on the new version. The default GP3 disk gives about 100 Mbps. - "In projects using Postgres 17, the following extensions are deprecated: plcoffee, plls, plv8, timescaledb, pgjwt." On pgjwt: "If you weren't explicitly using pgjwt in your project, it's most likely safe to disable."
- "Logical replication slots must be dropped." The page does not say whether the two Supabase-managed Realtime slots count.
- During the upgrade,
pg_cronis dropped and recreated, andcron.job_run_detailsis duplicated first. A very large table can fail the upgrade. Here it is 18 MB, because job 37 prunes it daily since 2026-09-21. - The page does not say that the upgrade runs
ANALYZE. Step 7 checks the table statistics. pg_upgraderefusesreg*columns that reference system OIDs. Custom roles with md5 passwords need manual migration. The repo creates no custom roles [repo: nocreate roleinpackages/supabase/].- "If the upgrade should fail, your original database would be brought back up online." The page describes no downgrade after a successful upgrade.
pg_graphql1.6.0 turns off introspection by default.config.toml~13 exposesgraphql_public, but no app code calls GraphQL. Only the generatedapps/webapp/src/types/supabase.tsmentions it [repo].
Target version. Target: Postgres 17 (ruling 2026-11-10). Local rehearsal uses supabase/postgres:17.11.0.007 (Supabase CLI 2.122.1). Before step 5, read the dashboard Upgrade page or GET /v1/projects/<project-ref>/upgrade/eligibility. Use its 17.x image if it differs.
Downtime. 62 MB is small, so fixed platform overhead will dominate. The security report says "plan for tens of minutes" [pred]. Use the dashboard's estimate if it shows one. Book a 60-minute window, or 90 minutes if step 4 cannot run on a copy.
No downgrade. If the upgrade fails, the old database comes back [docs]. After a successful upgrade, the only way back is a restore from a backup [pred]. That loses every write made after the backup.
Alerts will page during the window [repo]. sampleCronJobHealth in apps/hocuspocus.server/src/lib/workerMetricsSampler.ts calls cronJobLastSuccess.reset() when get_cron_job_health fails. The worker samples cron health every 180 s, since #323 shipped in 3235af138 on 2026-09-28. The cron-stale-frequent, cron-stale-daily, cron-stale-weekly and cron-stale-monthly rules in scripts/observability/grafana/provisioning/alerting/rules-supabase-jobs.yml use noDataState: Alerting with for: 5m. So an outage longer than about 5 to 8 minutes pages the ops channel (Telegram). pgmq-message-age (>15 m) and pgmq-poll-stalled (>2 m) in the same file may fire just after the database returns. synthetic-probe-failed on /health/supabase and the notification-worker rules will also fire.
Risk: new cron job ids [pred]. pg_cron is dropped and recreated, so the job ids may change. get_cron_job_health joins cron.job_run_details on jobid, with no foreign key. If an id changes, that job's old run history is orphaned, and last_success_at reads NULL until its next successful run. The worker then emits 0, and the matching cron-stale-* rule pages. The daily jobs recover within a day. cleanup_old_document_views waits for Sunday 03:00 UTC. create_document_views_partitions waits for the 1st of the month at 00:05 UTC. Step 7 compares the ids.
The upgrade resets pg_stat_statements. So step 1b saves the query-cost before first.
What to do
-
[maintainer] Record the baseline on prod (read-only). Run this in the SQL editor. Save the output; step 7 compares against it.
show server_version; select e.extname, e.extversion, n.nspname as schema from pg_extension e join pg_namespace n on n.oid = e.extnamespace order by e.extname; select jobid, jobname, schedule, active, username from cron.job order by jobname; select count(*) as run_details_rows, pg_size_pretty(pg_total_relation_size('cron.job_run_details')) as size from cron.job_run_details; select slot_name, plugin, slot_type, temporary, active from pg_replication_slots; select tablename from pg_publication_tables where pubname = 'supabase_realtime' order by 1; select evtname, evtevent, evtfoid::regproc from pg_event_trigger order by 1; select queue_name, queue_length, oldest_msg_age_sec from pgmq.metrics_all();
One minute before the slot read, open a pad's chat signed in, and keep it open.
Expected: 12 cron jobs, all
active. Asupabase_realtime%wal2json slot is active. Publication: record the full list. Step 7 compares against it. Theensure_rlsevent trigger.pg_netabsent, because Removepg_netfrom prod #321 landed. Keep thejobidof each job; step 7 compares them.Also record the email and push dead-letter depth:
queue_jobs{queue=~"email-notifications-dlq|push-notifications-dlq", state="waiting"}in Grafana Explore. For the email entries, also runscripts/drain-email-dlq.tsas a dry run.
1b. [maintainer] Save the query-cost before. Reuse the #325 day-7 one-hour snapshot pair. If it is not posted, take two pg_stat_statements snapshots one hour apart, with no deploy between, by the #323 method. Record calls, total and mean ms for realtime.list_changes and get_cron_job_health. Post the delta here.
-
[maintainer] Run the upgrade blockers check on prod (read-only).
-- a) Any user function that may call pgjwt (sign, verify, url_encode ...). -- Review each hit by hand; math "sign(" is a false positive. select n.nspname, p.proname from pg_proc p join pg_namespace n on n.oid = p.pronamespace where n.nspname not in ('pg_catalog', 'information_schema', 'extensions') and p.prosrc ~* '\m(sign|verify|url_encode|url_decode|algorithm_sign)\s*\('; -- b) Objects outside pgjwt that depend on a pgjwt function (views, defaults). select d.classid::regclass, d.objid, d.deptype from pg_depend d where d.refclassid = 'pg_proc'::regclass and d.refobjid in ( select m.objid from pg_depend m where m.classid = 'pg_proc'::regclass and m.refclassid = 'pg_extension'::regclass and m.refobjid = (select oid from pg_extension where extname = 'pgjwt') and m.deptype = 'e') and not exists ( select 1 from pg_depend x where x.classid = d.classid and x.objid = d.objid and x.refclassid = 'pg_extension'::regclass and x.deptype = 'e'); -- c) reg* columns that pg_upgrade refuses (regclass, regtype, regrole are fine). select c.oid::regclass as table_name, a.attname, a.atttypid::regtype from pg_attribute a join pg_class c on c.oid = a.attrelid join pg_namespace n on n.oid = c.relnamespace where a.attnum > 0 and not a.attisdropped and n.nspname not in ('pg_catalog', 'information_schema') and a.atttypid in ('regproc'::regtype, 'regprocedure'::regtype, 'regoper'::regtype, 'regoperator'::regtype, 'regconfig'::regtype, 'regdictionary'::regtype, 'regnamespace'::regtype, 'regcollation'::regtype); -- d) Logical slots that are not Supabase Realtime's own. select slot_name from pg_replication_slots where slot_type = 'logical' and slot_name not like 'supabase_realtime%';
Expected: (a) no hit that uses pgjwt, (b) 0 rows, (c) 0 rows, (d) 0 rows. The repo has no SQL use of pgjwt [repo]. If (a) or (b) shows a real user, stop and file a follow-up issue.
-
[agent] Rehearse the schema build on the target major, locally. This proves
scripts/*.sqland the seed build on the new image. It does not prove prod data.- This wipes the local Supabase volume, which other worktrees share. The maintainer approved the wipe on 2026-11-10. The local stack is a weaker copy of prod: it has no
ensure_rlsevent trigger, and its publication may differ from the step 1 list. - In
packages/supabase/config.toml~36, setmajor_versionto17. Do not commit it yet. - From
packages/supabase, runbunx dotenv -e ../../.env.local -- bunx supabase stop --no-backupto drop the old volume. This mirrors the packagestopscript. Then, from the repo root, runbun run --filter @docs.plus/supabase_back startandbun run --filter @docs.plus/supabase_back reset. - Run the step 1 SQL on the local database:
docker exec -i supabase_db_docsplus_supabase psql -U postgres -d postgres. Expect 12 cron jobs and four queues. Local job ids differ from prod. - Prove each pgmq call on a throwaway queue, not a live one. The cron jobs and the worker drain the live queues. Run
select pgmq.create('upgrade_probe');andselect pgmq.send('upgrade_probe', '{}'::jsonb);twice. Then runselect * from pgmq.read('upgrade_probe', 30, 2);,select pgmq.archive('upgrade_probe', <first msg_id>);andselect pgmq.delete('upgrade_probe', <second msg_id>);. End withselect pgmq.drop_queue('upgrade_probe');. - Run
bun run --filter @docs.plus/supabase_back types. Keep the regeneratedapps/webapp/src/types/supabase.tsif it changed. - Do not use the chatroom Cypress specs as proof.
stubChatroominapps/webapp/cypress/support/chatroomFixtures.ts~52 intercepts every Auth and REST call, so those specs never reach the database. - Smoke-test chat by hand against the local stack instead. The fresh reset has no pad, so sign in first. From the repo root, run
bun run dev. Sign in with an email link; the local mail UI ishttp://localhost:54324(config.toml~100-103). Create a pad and send a chat message. Open the pad as a guest in a second browser, and see the next message arrive live. - If any step fails on the new image, stop and report the error. Do not work around it in prod.
- If the prod upgrade will not follow within a few days, set
major_versionback to15and repeat the stop, start and reset.
- This wipes the local Supabase volume, which other worktrees share. The maintainer approved the wipe on 2026-11-10. The local stack is a weaker copy of prod: it has no
3b. [agent] Check what users see while Supabase is down, on the local stack. Open a local pad in Chrome and Safari. Run docker stop supabase_db_docsplus_supabase. Type in the pad, reload both browsers, and confirm the text stays. Send one chat message and record what the sender sees. Restart the container and record the message state. Post a table here.
-
[maintainer] Rehearse on a copy with prod data. This step is required. Prefer a new project restored from a prod backup, then upgrade that copy with the same button. A Supabase branch is a weak rehearsal here. It builds from
migrations/, and those do not build from empty (config.toml~53-58). Record the copy's upgrade minutes and its restore-to-pre-upgrade minutes. If the plan blocks a copy, write "no copy: plan limit" and book 90 minutes, not 60. Delete the copy afterwards, because compute is billed while it exists.- If you record "no copy: plan limit", prove the restore path another way. Take a dump as in step 5, and restore it on a local stack before the window. Post table row counts only, never rows.
-
[maintainer] Prepare the window.
- Stop unless the saved reads are done. The Find the cause of the 13-15 s realtime
list_changesspikes #325 reads must be posted, and the Find the cause of the 13-15 s realtimelist_changesspikes #325 and Measure prod memory, swap and CPU for 7 days before any compute change #324 7-day windows must have ended. Step 1b must be posted. The upgrade resets those counters. - Pick the window from data. In Prometheus, read the hour with the lowest
ws_active_connectionsover the last 14 days, and name it here. Avoid the 1st of the month at 00:05 UTC and Sunday at 03:00 UTC, when the monthly and weekly jobs run. Tell active users if any are known. - Confirm a fresh backup exists in the dashboard (Database > Backups). Record its time.
- Always take a fresh dump just before step 6, even if Back up the production stores off-host, and drill a restore #748 is live. From
packages/supabase, runbunx supabase db dump --linked -f <path outside the repo>for the schema, then the same with--data-only. Record the dump's UTC time here. - Silence the six rules of the Grafana
supabase-jobsgroup for 90 minutes:pgmq-poll-stalled,pgmq-message-ageandcron-stale-frequent,-daily,-weekly,-monthly. - Add a Grafana silence for
synthetic-probe-failedthat matches only the/health/supabaseinstance, for 90 minutes. - If step 2 (a) and (b) were clean and the target is Postgres 17, disable
pgjwtin Database > Extensions. - Do not drop the two
supabase_realtime*slots by hand. If the dashboard's pre-check refuses because of them, stop and ask Supabase support.
- Stop unless the saved reads are done. The Find the cause of the 13-15 s realtime
-
[maintainer] Run the upgrade. Use "Upgrade project" on the General settings page (or Settings > Infrastructure). Note the start and end time in UTC. If it fails, the docs say the old database comes back online. Then re-run step 1 and record what failed on this issue.
- Before the window, create a scratch pad you own. During the window, send 5 chat messages on it. Record each as sent, error shown, or lost. Delete the scratch pad after step 7.
-
[maintainer] Post-checks on prod, in this order.
-
Re-run the step 1 SQL. Compare: new
server_version; same 12 jobs, all active; the same publication tables as the step 1 baseline;ensure_rls,pgrst_ddl_watchandpgrst_drop_watchstill present. Other Supabase-managed event triggers may differ on the new image. -
Slots: one minute before the read, open a pad's chat signed in, and keep it open. Run
select slot_name, plugin, slot_type, temporary, active from pg_replication_slots;. Pass: asupabase_realtime%wal2json slot is active, and a new message arrives live in a second browser. -
Compare each job's
jobidwith the baseline. If any id changed, expect the matchingcron-stale-daily,-weeklyor-monthlyrule to page until that job's next success. Keep a silence only for that job: match itsjobnamelabel, not the whole rule. Note the ids on this issue. -
Refresh planner statistics. Before Postgres 18,
pg_upgradedoes not carry them, and it resets the counters inpg_stat_user_tables. Runselect relname, last_analyze, last_autoanalyze from pg_stat_user_tables where schemaname = 'public' order by relname;. Unless every busy table shows a time after the upgrade, runanalyze;. At 62 MB it is short. It is a maintenance write, not a schema change. -
After 30 minutes, check the cron runs:
select j.jobname, max(d.start_time) as last_start, (array_agg(d.status order by d.start_time desc))[1] as last_status from cron.job j left join cron.job_run_details d on d.jobid = j.jobid and d.start_time > now() - interval '1 hour' group by j.jobname order by j.jobname;
Every job on a 1, 2, 5, 10 or 15-minute schedule must show
succeeded. Daily, weekly and monthly jobs show NULL until their slot; check them the next day. -
Re-run
select queue_name, queue_length, oldest_msg_age_sec from pgmq.metrics_all();. All four queues must be present.oldest_msg_age_secmust be NULL (empty queue) or below 300 within 15 minutes. -
App checks: send a chat message signed in and see it arrive live in a second browser. Get a push notification on a second device. See one notification email leave
email_queue. Open a document and see its view count rise after the nextprocess_document_views_queuerun. -
A signed-in owner opens a Private pad, edits, reloads, and the edits stay.
-
Email and push dead-letter depth equals the step 1 values, and
Notification job failuresis Normal. -
Open Advisors > Security.
vulnerable_postgres_versionmust be gone. The ERROR count must stay 0. Runpackages/supabase/scripts/check-grants.sql. It must return 0 rows, as it did on prod on 2026-11-03. -
Remove the Grafana silences, except any kept for changed job ids. The other
supabase-jobsrules must beNormal. -
24 hours after the upgrade, repeat the step 1b snapshot pair. Post it beside the before.
-
Read the outage seconds with the Benchmark query, and fill the Benchmark tables.
-
7b. [maintainer] Restore rule. If chat, Auth or any sub-hourly cron job still fails 60 minutes after the upgrade ends, restore the pre-upgrade backup. Name the source before you start: the dashboard backup or the step 5 fresh dump, with its UTC time. Prefer the newer one. Write the expected lost-write window in minutes, from the source time to the upgrade start. Then record the real lost-write window.
- [agent] Bring the repo in line, after step 7 passes.
- Set
major_versioninpackages/supabase/config.toml~36 to the prod major fromshow server_version. - If
pgjwtwas disabled, fix bothpgjwtmentions inpackages/supabase/CLAUDE.md. The seed-batch bullet sayspgjwtlives inextensions. The new-objects bullet listspgjwtamong the extensions thatpostgresowns on prod. - Run
bun run --filter @docs.plus/supabase_back resetandbun run --filter @docs.plus/supabase_back types. Includeapps/webapp/src/types/supabase.tsif it changed. - Leave the change uncommitted for the maintainer's
/commit-review.
- Set
Out of scope
- Porting the 2026-09-28 grant and RLS fix into the repo: Port the 2026-09-28 prod grant and RLS fix into scripts and a paired migration #314.
- Dropping
pg_netand fixing its "relocatable" claim: Removepg_netfrom prod #321. - The read-only grant guard: Add a read-only grant guard to run after each
db push#317. - Any compute size change: Measure prod memory, swap and CPU for 7 days before any compute change #324.
- The 13-15 s Realtime
list_changesspikes: Find the cause of the 13-15 s realtimelist_changesspikes #325. - The anon EXECUTE revoke on the three invoker notification RPCs: Revoke anon and public EXECUTE on three invoker notification RPCs #755.
- Any SQL change beyond
config.tomland theCLAUDE.mdlines.
Acceptance criteria
- The step 1 baseline and the step 2 blocker results are recorded in a comment on this issue.
- The step 1b query-cost snapshot pair is posted before the upgrade.
- Step 2 shows no pgjwt user, no refused
reg*column, and no non-Realtime logical slot. - A local reset on the target major succeeds, with 12 cron jobs and four pgmq queues.
- On the local target-major stack, a guest reads a pad's chat, and a signed-in message arrives live in a second browser.
- Pad text survives a Supabase outage on the local stack (step 3b).
- Restore minutes are measured on the copy, or "no copy: plan limit" is recorded.
- Prod
show server_versionreports a newer version than 15.8, and the linter no longer listsvulnerable_postgres_version. - The linter ERROR count is still 0 after the upgrade.
- All 12 cron jobs are active. Every sub-hourly job shows
succeededwithin one hour. Daily, weekly and monthly jobs succeed on their next slot. - Any change of cron job id is recorded on this issue.
- A
supabase_realtime%wal2json slot is active while a chat is open. - The publication still lists the same tables as the step 1 baseline.
- All four pgmq queues are present and draining, with
oldest_msg_age_secNULL or below 300. - Chat, push, email and document views each work once end to end on prod.
- Lost chat messages: 0 of 5.
-
packages/supabase/config.tomlmajor_versionmatches prod, and a local reset passes with it. - Benchmark table filled.
Verification
- Prod version:
show server_version;returns a version newer than 15.8. The dashboard shows the new image, and the linter no longer names 15.8.1.073. - Linter: Advisors > Security shows no
vulnerable_postgres_versionrow and 0 ERROR rows. - Cron: within one hour, the step 7 cron query shows
succeededforupdate-user-status,aggregate_document_view_stats,cleanup-push-subscriptions,process_email_queue,compile_digest_emails,message_counter_batch_jobandprocess_document_views_queue. Use names, because ids may change. - Queues:
select queue_name, oldest_msg_age_sec from pgmq.metrics_all();returns four rows, each NULL or below 300. - Slots: with a chat open,
select slot_name, active from pg_replication_slots;returns asupabase_realtime%wal2json slot withactive = t, and a new message arrives live in a second browser. - Grafana: the
supabase-jobsrules areNormal30 minutes after the silences end. A rule kept silent for a changed job id isNormalafter that job's next run. - Repo:
grep -n major_version packages/supabase/config.tomlshows the prod major.bun run --filter @docs.plus/supabase_back resetexits 0.
House rules
- Bun only. Never run
npm,yarn,pnpmornpx. Usebunx supabasefor the CLI. - Agents have no prod access. Every prod read or write in this issue is a [maintainer] step.
- Never hand-edit
packages/supabase/seed.sqlorapps/webapp/src/types/supabase.ts. Regenerate them with theresetandtypesscripts. - Keep
[db.migrations] enabled = falseinconfig.toml. Never edit an applied migration. - No commits unless the maintainer asks. Leave repo changes for
/commit-review.
Activity
HMarzban commentedon Nov 3, 2026
Status, 2026-11-03. No step of this issue has run yet.
packages/supabase/config.tomlstill setsmajor_version = 15onmain. Left, in order:list_changesspikes #325 steps 1 and 2 to be posted on Find the cause of the 13-15 s realtimelist_changesspikes #325.list_changesspikes #325 7-day windows. Then [agent] runs step 8.HMarzban commentedon Nov 3, 2026
Status, 2026-11-03 (after the 1b05cb2 deploy). The first item is done. Every pending Supabase migration was pushed to production on 2026-11-03, so the baseline can match the repo (close comments on #579, #605 and #661).
packages/supabase/config.toml:36still setsmajor_version = 15. Left, in order:list_changesspikes #325 steps 1 and 2 to be posted on Find the cause of the 13-15 s realtimelist_changesspikes #325.list_changesspikes #325 7-day windows. Then [agent] runs step 8.HMarzban commentedon Nov 4, 2026
Maintainer ruling, 2026-11-04
Moved from milestone v2.3.0 to milestone v2.4.0, from the v2.3.0 open-issue review. It ships no v2.3.0 code. It must wait for the #323 hour and #325 steps 1–2, and it must run outside the #324 and #325 windows.
The issue stays open. Its remaining items are unchanged.
HMarzban commentedon Nov 10, 2026
Maintainer ruling, 2026-11-10
Answer: "yes, just ask the supabase for postgress version, you can also find out from the docker we have in supabase".
supabase/postgres:15.8.1.073. The local containersupabase_db_docsplus_supabaseshowed that image on 2026-11-10.supabase/postgres:17.11.0.007formajor_version = 17, and15.19.0.007for 15. So step 3 setsmajor_version = 17and rehearses on17.11.0.007.GET /v1/projects/tglymsfloxmouzjuoycu/upgrade/eligibilityliststarget_upgrade_versions. It needs the CLI login, and that call waited on a keychain prompt. Read it, or the "Upgrade project" page in the dashboard, before step 5. If it offers a different 17.x image, rehearse on that one.The order rules are unchanged: steps 4 to 7 run after #325 steps 1 and 2 are posted, and outside the #324 and #325 windows.
[-]Upgrade prod Postgres from 15.8.1.073[/-][+]Upgrade Supabase Postgres from 15.8.1.073 to 17[/+]HMarzban commentedon Nov 11, 2026
Maintainer ruling, 2026-11-11
This issue stays in milestone v2.3.6, the benchmark milestone. This voids the move to v2.4.0 in the ruling of 2026-11-04. The issue gathers before-and-after evidence for the Supabase upgrade, so it belongs here.
The #323 hour is done: 40 calls in 3,607 s, measured on 2026-11-07. The order rules still hold. Steps 4 to 7 wait for three things:
list_changesspikes #325 reads are posted;list_changesspikes #325 and Measure prod memory, swap and CPU for 7 days before any compute change #324 7-day windows have ended.The body now has a Benchmark section. Step 1b saves the
pg_stat_statementsbefore, because the upgrade resets it.HMarzban commentedon Nov 12, 2026
Moved to v2.3.7, 2026-11-12 (maintainer ruling). v2.3.6 ships on 2026-11-14 with only finished, measured work, and its 7-day measurement windows cannot finish by then. The before values and the plan in this issue stay as they are.
HMarzban commentedon Nov 16, 2026
Review, 2026-11-16 (maintainer approved).
list_changesspikes #325 day-7 one-hour snapshot pair. The ban on reading inside the Find the cause of the 13-15 s realtimelist_changesspikes #325 or Measure prod memory, swap and CPU for 7 days before any compute change #324 window is gone, because a read does not reset counters.pg_stat_statements_resetline topackages/supabase/CLAUDE.md. It served only Find the cause of the 13-15 s realtimelist_changesspikes #325.