Skip to content

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

Draft
Crispy1975 wants to merge 1 commit intodevelopfrom
fix/lower-default-max-slot-wal-keep-size
Draft

fix: lower default max_slot_wal_keep_size from 4096MB to 512MB#2130
Crispy1975 wants to merge 1 commit 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
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.
@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.

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