pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stephen Frost <sfrost@snowman.net>
To: Adrian Klaver <adrian.klaver@aklaver.com>
Cc: Phil Endecott <spam_from_pgsql_lists@chezphil.org>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: Replication failure, slave requesting old segments
Date: Mon, 13 Aug 2018 10:11:54 -0400
Message-ID: <20180813141154.GM3326@tamriel.snowman.net> (raw)
In-Reply-To: <07fbb899-570d-ccf2-a4ad-11d6cc295ed3@aklaver.com>
References: <31ba3812-6a0a-4639-5386-e804e59bc322@aklaver.com>
	<1534162092902@dmwebmail.dmwebmail.chezphil.org>
	<07fbb899-570d-ccf2-a4ad-11d6cc295ed3@aklaver.com>

Greetings,

* Adrian Klaver (adrian.klaver@aklaver.com) wrote:
> On 08/13/2018 05:08 AM, Phil Endecott wrote:
> >Adrian Klaver wrote:
> >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.

That's correct.

> See also my reply to Stephen earlier. Basically you are trying to coordinate
> two different operations. They start from the same source pg_xlog(pg_wal
> 10+) but arrive on a different time scale and from different locations.
> Without sufficient sanity checks it is possible they diverge enough on one
> or both paths to render the process unstable.

This isn't what's happening.  We're not talking about a timeline change
here or a replica being promoted to be a primary in general.  There's no
diverging happening- it's the same consistent WAL stream, just coming
from two different sources, which PG is specifically designed to handle
and should be handling seamlessly.

> I would say that:
> 
> "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."
> 
> should be more like:
> 
> "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. *This is dependent on
> verification that the archiving is working properly. A belt and suspenders
> approach would be to set wal_keep_segments to a value > 0 in the event
> archiving is not properly functioning*"
> "

I don't think I can disagree more with this additional wording, and I
*really* don't think we should be encouraging people to set a high
wal_keep_segments.  The specific case here looks like it just need to be
set to, exactly, '1', to ensure that the primary hasn't removed the last
WAL file that it archived.

Thanks!

Stephen

Attachments:

  signature.asc (application/pgp-signature, 818B) download

view thread (25+ messages)  latest in thread

Message-ID: <20180813141154.GM3326@tamriel.snowman.net>
Permalink:  ../20180813141154.GM3326@tamriel.snowman.net/
Also on:    postgresql.org/message-id/20180813141154.GM3326@tamriel.snowman.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: sfrost@snowman.net, adrian.klaver@aklaver.com, spam_from_pgsql_lists@chezphil.org
  Subject: Re: Replication failure, slave requesting old segments
  In-Reply-To: <20180813141154.GM3326@tamriel.snowman.net>
  References: <31ba3812-6a0a-4639-5386-e804e59bc322@aklaver.com> <1534162092902@dmwebmail.dmwebmail.chezphil.org> <07fbb899-570d-ccf2-a4ad-11d6cc295ed3@aklaver.com> <20180813141154.GM3326@tamriel.snowman.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox