Configure wal_keep_segments for postgres streaming replication #515

Closed
opened 2023-10-02 11:31:20 +00:00 by raucao · 0 comments
Owner

Currently, it's easy to get the replica out of sync, when the WAL log on the primary is too far ahead (e.g. after a longer downtime):

From the docs:

If you use streaming replication without file-based continuous archiving, the server might recycle old WAL segments before the standby has received them. If this occurs, the standby will need to be reinitialized from a new base backup. You can avoid this by setting wal_keep_segments to a value large enough to ensure that WAL segments are not recycled too early, or by configuring a replication slot for the standby. If you set up a WAL archive that's accessible from the standby, these solutions are not required, since the standby can always use the archive to catch up provided it retains enough segments.

Currently, it's easy to get the replica out of sync, when the WAL log on the primary is too far ahead (e.g. after a longer downtime): From [the docs](https://www.postgresql.org/docs/12/warm-standby.html#STREAMING-REPLICATION): > If you use streaming replication without file-based continuous archiving, the server might recycle old WAL segments before the standby has received them. If this occurs, the standby will need to be reinitialized from a new base backup. You can avoid this by setting wal_keep_segments to a value large enough to ensure that WAL segments are not recycled too early, or by configuring a replication slot for the standby. If you set up a WAL archive that's accessible from the standby, these solutions are not required, since the standby can always use the archive to catch up provided it retains enough segments.
raucao added the
enhancement
label 2023-10-02 11:31:20 +00:00
raucao added the
service
postgres
label 2023-10-06 14:04:52 +00:00
greg closed this issue 2023-10-07 08:18:25 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: kosmos/chef#515
No description provided.