pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: 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: Sat, 4 Aug 2018 22:13:12 +0900
Message-ID: <20180804131312.GH20967@paquier.xyz> (raw)
In-Reply-To: <20180804115945.k54bivte737gkicv@alap3.anarazel.de>
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>

On Sat, Aug 04, 2018 at 04:59:45AM -0700, Andres Freund wrote:
> On 2018-08-04 10:54:22 +0100, Simon Riggs wrote:
>> pg_rewind doesn't work correctly. Documenting a workaround doesn't change that.
> 
> Especially because most people will only understand this after they've
> been hit, as test scenarios will often just be quick enough.

Well, since its creation we have the tool behave this way.  I am not
sure either that we can have pg_rewind create a checkpoint on the source
node each time a rewind is done, as it may not be necessary, and it
would enforce WAL segment recycling more than necessary, so if we were 
to back-patch something like that I am pretty much convinced that we
would get complains from people already using the tool, with existing
failover flows which are broken.  Making this stuff to not need a
checkpoint is actually possible.  When the source is offline, the
control file can be relied on as the shutdown checkpoint would update
the on-disk control file.  When the source is online, pg_rewind only
needs to know the new timeline number from the source, which we could
provide via a SQL function, but that would work only on HEAD (look at
ControlFile_source, you would see that only the new TLI matters, and
that getTimelineHistory does not really need to know the contents of the
control file).
--
Michael

Attachments:

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

view thread (14+ messages)  latest in thread

Message-ID: <20180804131312.GH20967@paquier.xyz>
Permalink:  ../20180804131312.GH20967@paquier.xyz/
Also on:    postgresql.org/message-id/20180804131312.GH20967@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, andres@anarazel.de, simon@2ndquadrant.com, Richard.Schmidt@metservice.com
  Subject: Re: Pg_rewind cannot load history wal
  In-Reply-To: <20180804131312.GH20967@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>

* 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