pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: Stephen Frost <sfrost@snowman.net>
Cc: Andres Freund <andres@anarazel.de>
Cc: pgsql-bugs@lists.postgresql.org, Alexander Kukushkin <cyberdemn@gmail.com>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Dmitry Dolgov <9erthalion6@gmail.com>
Subject: Re: BUG #15346: Replica fails to start after the crash
Date: Tue, 28 Aug 2018 21:59:45 +0900
Message-ID: <20180828125945.GG29157@paquier.xyz> (raw)
In-Reply-To: <20180828122311.GD3326@tamriel.snowman.net>
References: <CA+q6zcVjv1Lp-3=prBbpq2CbBioK91SHarfw3F8FHuUN4EwcUA@mail.gmail.com>
	<20180822175034.lnvwk5js32k6mjyz@alvherre.pgsql>
	<20180823041420.GA1158@paquier.xyz>
	<CAFh8B==4gpwor6ODercru0iifqwd0nQrdRvXzmorWkMRQa4q=g@mail.gmail.com>
	<CAFh8B=nHdsX83hTZMqGqbht39ud+DRQOv4_Te+xu3DuPssQbZA@mail.gmail.com>
	<CAFh8B=mYGP1J8ueHKU40Dr4bNBUPJj1rTbZ6Wpg4gR30uCRunA@mail.gmail.com>
	<20180828024409.GB29157@paquier.xyz>
	<3B69F535-FD81-461B-97E9-657D4C99EDB4@anarazel.de>
	<20180828122311.GD3326@tamriel.snowman.net>

On Tue, Aug 28, 2018 at 08:23:11AM -0400, Stephen Frost wrote:
> * Andres Freund (andres@anarazel.de) wrote:
>> Uh, where is that "control file last" bit coming from?
> 
> pg_basebackup copies it last.  The comments should probably be improved
> as to *why* but my recollection is that it's, at least in part, to
> ensure the new cluster can't be used until it's actually a complete
> backup.

What we have now is mainly in basebackup.c.  See 8366c780 which
introduced that.  Stephen has that right, as we cannot rely on an
end-backup record when taking a backup from a standby, copying the
control file last ensures that the consistent point should be late
enough that no other pages are inconsistent.  Even with that, I think
that there is still a small race condition but I cannot put my finger on
it now.  I agree that the current comments do a bad job as to why this
happens.  That's actually something I discovered when discussing what
has resulted in f267c1c2.
--
Michael

Attachments:

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

view thread (35+ messages)  latest in thread

Message-ID: <20180828125945.GG29157@paquier.xyz>
Permalink:  ../20180828125945.GG29157@paquier.xyz/
Also on:    postgresql.org/message-id/20180828125945.GG29157@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 using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: michael@paquier.xyz, sfrost@snowman.net, andres@anarazel.de, cyberdemn@gmail.com, alvherre@2ndquadrant.com, 9erthalion6@gmail.com
  Subject: Re: BUG #15346: Replica fails to start after the crash
  In-Reply-To: <20180828125945.GG29157@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