pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: Christophe Pettus <xof@thebuild.com>
Cc: Andres Freund <andres@anarazel.de>
Cc: Simon Riggs <simon@2ndquadrant.com>
Cc: Richard Schmidt <Richard.Schmidt@metservice.com>
Cc: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: Pg_rewind cannot load history wal
Date: Sun, 5 Aug 2018 05:50:26 +0900
Message-ID: <20180804205026.GJ20967@paquier.xyz> (raw)
In-Reply-To: <EE81B078-37FE-43B3-8083-0BC78ACF0699@thebuild.com>
References: <HK0PR01MB200359DEA9A85774C9E3A799912D0@HK0PR01MB2003.apcprd01.prod.exchangelabs.com>
	<20180803205922.GC20967@paquier.xyz>
	<CANP8+j+fR79iX=39LRnrwne7Wp5xDmRyLBnmQ5=4ZUjscNDbag@mail.gmail.com>
	<20180804065654.GF20967@paquier.xyz>
	<CANP8+jJmq0zns1UWObnOJH6fdUwCzby2xnxok5uJqMpegm8dEQ@mail.gmail.com>
	<20180804115945.k54bivte737gkicv@alap3.anarazel.de>
	<20180804131312.GH20967@paquier.xyz>
	<EE81B078-37FE-43B3-8083-0BC78ACF0699@thebuild.com>

On Sat, Aug 04, 2018 at 07:54:36AM -0700, Christophe Pettus wrote:
> Would having pg_rewind do a checkpoint on the source actually cause
> anything to break, as opposed to a delay while the checkpoint
> completes?

Users relying only on streaming without archives would be impacted as
potentially two checkpoints could be used on the promoted standby,
making all past segment needed from the divergence point not to be
around.  That's a problem which exists in v11 as only WAL segments worth
one checkpoint are kept around, not for 9.5, 9.6 and 10.

> The current situation can create a corrupted target, which seems far
> worse than just slowing down pg_rewind.

Hm?  pg_rewind requires the target to be stopped properly, meaning that
the divergence point is known to both nodes.  If the source is online
and has not created the first post-recovery checkpoint, then you would
get a no-op with pg_rewind, and when restarting the old master witha
recovery.conf you would get a failure.  If you stop the old master
so as at next startup it needs crash recovery to recover, then there is
indeed a risk of corrupted instance, but that would be the same problem
even if pg_rewind is used.
--
Michael

Attachments:

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

view thread (14+ messages)  latest in thread

Message-ID: <20180804205026.GJ20967@paquier.xyz>
Permalink:  ../20180804205026.GJ20967@paquier.xyz/
Also on:    postgresql.org/message-id/20180804205026.GJ20967@paquier.xyz

 · 

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: michael@paquier.xyz, xof@thebuild.com, andres@anarazel.de, simon@2ndquadrant.com, Richard.Schmidt@metservice.com
  Subject: Re: Pg_rewind cannot load history wal
  In-Reply-To: <20180804205026.GJ20967@paquier.xyz>
  References: <HK0PR01MB200359DEA9A85774C9E3A799912D0@HK0PR01MB2003.apcprd01.prod.exchangelabs.com> <20180803205922.GC20967@paquier.xyz> <CANP8+j+fR79iX=39LRnrwne7Wp5xDmRyLBnmQ5=4ZUjscNDbag@mail.gmail.com> <20180804065654.GF20967@paquier.xyz> <CANP8+jJmq0zns1UWObnOJH6fdUwCzby2xnxok5uJqMpegm8dEQ@mail.gmail.com> <20180804115945.k54bivte737gkicv@alap3.anarazel.de> <20180804131312.GH20967@paquier.xyz> <EE81B078-37FE-43B3-8083-0BC78ACF0699@thebuild.com> <20180804205026.GJ20967@paquier.xyz>

* 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