postgres icon indicating copy to clipboard operation
postgres copied to clipboard

Update postgresql.conf to increase max_slot_wal_keep_size

Open encima opened this issue 1 year ago • 3 comments

What kind of change does this PR introduce?

Increases max_slot_wal_keep_size default from 1GB

What is the current behavior?

Current behaviour is 1GB by default.

As this is a setting we do not expose, the current default is too low to successfully replicate using a tool like Airbyte (as the WAL will grow too large during the Hourly sync window).

What is the new behavior?

Proposing to set this as 4GB by default but 2GB could be a conservative option.

Additional context

Some relevant issues are noted in the (internal) Notion document

encima avatar May 27 '24 10:05 encima

Just curious - have y'all thought about making this configurable per https://supabase.com/docs/guides/platform/custom-postgres-config instead of upping the threshold?

Tang8330 avatar Jun 23 '24 20:06 Tang8330

For customers that have a large Supabase instance, it'd be nice to have this number be a % of the total database size as opposed to having it fixed to 1GB (or soon 4GB)

Tang8330 avatar Jun 23 '24 20:06 Tang8330

Just curious - have y'all thought about making this configurable per https://supabase.com/docs/guides/platform/custom-postgres-config instead of upping the threshold?

Yes, this should certainly be done. This current setting is to allow replication to function on all instances now but should be configurable in the future (currently it cannot be due to some infra designs but it will be).

encima avatar Jun 24 '24 10:06 encima

Hi :wave: - checking in on the status of this increase.

Our (https://estuary.dev/) users frequently encounter logical replication slot invalidations due to the current 1GB setting. It's far too small in real-world usage, even after users make best-effort mitigations to prevent large transactions.

It would of course be wonderful to see this be configurable, but increasing to 4GB would stop much of the bleeding.

jgraettinger avatar Jul 12 '24 14:07 jgraettinger

@thebengeu is this OK to merge now that it has passed checks?

encima avatar Jul 15 '24 07:07 encima

@encima yes, good to merge. Note that this change only affects new projects, and we'll need to roll out the change to existing projects where desired.

thebengeu avatar Jul 15 '24 08:07 thebengeu