Skip to content

fix: lower default max_slot_wal_keep_size from 4096MB to 512MB#2130

Open
Crispy1975 wants to merge 3 commits intodevelopfrom
fix/lower-default-max-slot-wal-keep-size
Open

fix: lower default max_slot_wal_keep_size from 4096MB to 512MB#2130
Crispy1975 wants to merge 3 commits intodevelopfrom
fix/lower-default-max-slot-wal-keep-size

Conversation

@Crispy1975
Copy link
Copy Markdown
Contributor

@Crispy1975 Crispy1975 commented Apr 30, 2026

Summary

  • max_slot_wal_keep_size was set to 4096MB, exceeding the total disk size of free tier projects (2GB) — a lagging or disconnected replication slot could fill the disk entirely before Postgres invalidates it
  • Lowered to 512MB, which fits safely within free tier disk overhead
  • Free tier projects cannot attach physical replicas, but logical replication slots are still possible (e.g. Supabase Realtime, logical replication, CDC tools) and this setting applies to all slot types
  • WAL archiving to S3 via archive_command means local WAL retention is not required for recovery, so a lower cap has no impact on PITR

Test plan

  • Verify Postgres starts correctly with the new default on an AMI build
  • Confirm Supabase Realtime slot is not affected under normal operation
  • Confirm a lagging slot is invalidated at ~512MB rather than ~4GB
  • Consider whether this should be tier-specific in a follow-up

@Crispy1975 Crispy1975 requested review from a team as code owners April 30, 2026 11:00
@Crispy1975 Crispy1975 force-pushed the fix/lower-default-max-slot-wal-keep-size branch from 8623ef2 to 8811421 Compare April 30, 2026 12:24
@Crispy1975 Crispy1975 changed the title fix: lower default max_slot_wal_keep_size from 4096MB to 1024MB fix: lower default max_slot_wal_keep_size from 4096MB to 512MB Apr 30, 2026
Copy link
Copy Markdown
Contributor

@hunleyd hunleyd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Crispy1975 Crispy1975 marked this pull request as draft April 30, 2026 16:03
Copy link
Copy Markdown

@hitmands hitmands left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this change isn't scoped to the free tier only, and as per my comment here https://github.com/supabase/supabase-admin-api/pull/316#pullrequestreview-4210781796, I think this affects how the replication streaming works.

@Crispy1975 Crispy1975 force-pushed the fix/lower-default-max-slot-wal-keep-size branch from 8811421 to 113c4ab Compare May 5, 2026 16:38
@Crispy1975 Crispy1975 self-assigned this May 5, 2026
@Crispy1975 Crispy1975 marked this pull request as ready for review May 5, 2026 16:41
@Crispy1975
Copy link
Copy Markdown
Contributor Author

this change isn't scoped to the free tier only, and as per my comment here supabase/supabase-admin-api#316 (review), I think this affects how the replication streaming works.

The AMI is a base default, but admin-api makes the per compute changes.

Crispy1975 added 3 commits May 6, 2026 11:08
The 4096MB default exceeds the total disk size of free tier projects
(2GB), risking disk exhaustion from a lagging or disconnected slot.
512MB fits safely within free tier disk overhead while still providing
a reasonable buffer for logical replication slots (e.g. Realtime, CDC).
WAL archiving to S3 means local retention is not needed for recovery.
postgresorioledb-17: 17.6.0.072-orioledb -> 17.6.0.073-orioledb
postgres17: 17.6.1.115 -> 17.6.1.116
postgres15: 15.14.1.115 -> 15.14.1.116
@Crispy1975 Crispy1975 force-pushed the fix/lower-default-max-slot-wal-keep-size branch from 7448f90 to b39ec60 Compare May 6, 2026 10:10
@Crispy1975 Crispy1975 enabled auto-merge May 6, 2026 10:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants