Re: Replication failure, slave requesting old segments - Mailing list pgsql-general

From Stephen Frost
Subject Re: Replication failure, slave requesting old segments
Date
Msg-id 20180813123915.GD3326@tamriel.snowman.net
Whole thread Raw
In response to Re: Replication failure, slave requesting old segments  ("Phil Endecott" <spam_from_pgsql_lists@chezphil.org>)
Responses Re: Replication failure, slave requesting old segments
List pgsql-general
Greetings,

* Phil Endecott (spam_from_pgsql_lists@chezphil.org) wrote:
> Adrian Klaver wrote:
> >On 08/12/2018 02:56 PM, Phil Endecott wrote:
> >>Anyway.  Do others agree that my issue was the result of
> >>wal_keep_segments=0 ?
> >
> >Only as a sub-issue of the slave losing contact with the master. The basic
> >problem is maintaining two separate operations, archiving and streaming,
> >in sync. If either or some combination of both lose synchronization then
> >it is anyone's guess on what is appropriate for wal_keep_segments.

Uh, no, having an archive_command and a restore_command configures
exactly should remove the need to worry about what wal_keep_segments is
set to because anything not on the primary really should be available
through what's been archived and PG shouldn't have any trouble figuring
that out and working with it.

If all you've got is streaming replication then, sure, you have no idea
what to set wal_keep_segments to because the replica could be offline
for an indeterminate amount of time, but as long as you're keeping track
of all the WAL through archive_command, that shouldn't be an issue.

> Really?  I thought the intention was that the system should be
> able to recover reliably when the slave reconnects after a
> period of downtime, subject only to there being sufficient
> network/CPU/disk bandwidth etc. for it to eventually catch up.

Yes, that's correct, the replica should always be able to catch back up
presuming there's no gaps in the WAL between when the replica failed and
where the primary is at.

Thanks!

Stephen

Attachment

pgsql-general by date:

Previous
From: Tomas Vondra
Date:
Subject: Re: is there any adverse effect on DB if I set autovacuum scalefactor to zero?
Next
From: Laurenz Albe
Date:
Subject: Re: How to get connection details from psql -> \e