Skip to main content

Timeline for Why is pg_wal filling up?

Current License: CC BY-SA 4.0

9 events
when toggle format what by license comment
Dec 12, 2022 at 10:09 comment added Laurenz Albe Yes, but only if a replication slot is in use.
Dec 12, 2022 at 9:35 comment added Marc Could it be that pg_wal/ overflowed because the standby disconnected for several days?
Dec 12, 2022 at 9:34 comment added Marc Must be "something" then because I have not changed max_slot_wal_keep_size and I could not delete the slot. I have a bad feeling that this problem resolved itself but could reappear again. Can I set max_slot_wal_keep_size to 1000000000 (1Gb) to avoid disk overflow in the future?
Dec 12, 2022 at 7:09 comment added Laurenz Albe Either you dropped the replication slot, or something moved it ahead, or you have reached max_slot_wal_keep_size.
Dec 12, 2022 at 7:07 comment added Marc OK, thank-you for the explanation. I guess the mystery now is: why is my primary server now clearing pg_wal/ nicely without a configured primary_slot_name on the standby?
Dec 10, 2022 at 15:01 comment added Laurenz Albe A replication slot is not necessary for replication. It is necessary for the primary to remember how much WAL it must retain in case the standby disconnects. As soon as you set primary_slot_name, the standby will make the primary move the slot ahead, so WAL on the primary can be removed.
Dec 10, 2022 at 10:20 comment added Marc Also, your explanation implies that the standby would not "use" the slot - but replication is working fine. Could it be that when I ran pg_basebackup and provided a slot name that it is persisted somewhere else? It's not in postgresql.conf.
Dec 10, 2022 at 10:18 comment added Marc OK, this is weird - I havent configured primary_slot_name on the standby - it's commented out - but suddenly the pg_wal/ directory is NOT filling up. What is also weird is that primary_slot_name is not mentioned in any guide on streaming replication.
Dec 9, 2022 at 9:04 history answered Laurenz Albe CC BY-SA 4.0