Comment 2 for bug 1547238

Revision history for this message
Stuart Bishop (stub) wrote :

The setting is working as intended. wal_keep_segments=5000 does indeed tell PostgreSQL to keep 80GB of WAL files around, and of course you can't fit 80GB of files on a 5GB partition.

The setting is used as a replication buffer. If a standby lags behind, the master remains oblivious and will happily remove WAL files even if they haven't been sent to the standby. This causes replication to that standby to fail, and it needs to be rebuilt. Setting wal_keep_segments to 80GB provides an 80GB lag buffer to minimize the chances of this happening, and was chosen as it was the default used by the repmgr tool.

I agree this needs to be tuned better, and disk space recommendations documented. Also, we can take advantage of the replication slots feature available in 9.4 which makes this lag buffer dynamic.

I'll call this bug closed when:
 - wal_keep_segments defaults to 0 when there are no standbys
 - even when there are standbys, wal_keep_segments defaults to a smaller value.
 - Recommended partition size is documented in README.md