pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: Andre Piwoni <apiwoni@webmd.net>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: Promoted slave tries to archive previously archived WAL file
Date: Mon, 18 Feb 2019 10:27:42 +0900
Message-ID: <20190218012742.GH1864@paquier.xyz> (raw)
In-Reply-To: <CAEC-+VHAQVCCCiT0pEcg=CZvmXUFeFDGaxGJgFtv5+G7NOqjAA@mail.gmail.com>
References: <CAEC-+VGYLE+mwwVtyiUD7D6-w4KoKxA+g_q4KE=B54gFw6Fy_g@mail.gmail.com>
	<CAEC-+VHAQVCCCiT0pEcg=CZvmXUFeFDGaxGJgFtv5+G7NOqjAA@mail.gmail.com>

On Fri, Feb 15, 2019 at 12:03:39PM -0800, Andre Piwoni wrote:
> My slave nodes were created using pg_basebackup with --wal-method=stream.
> If I understand right this option streams WAL files generated during backup
> and this WAL file was 000000010000000000000002 but its contents were
> different from what was on the primary and in WAL archive. When I changed
> --wal-method=fetch which collects WAL files generated during the backup at
> the end then diff did not detect any changes. When I failover I don't seem
> to have the issue with new primary to archive.
> 
> It seems streaming WAL segments created during backup produced corrupt file
> based on diff.

Nope, --wal-method=stream and fetch behave as they are designed for.
"fetch" would include all the contents of pg_wal/ as part of a
BASE_BACKUP command using the replication protocol while "stream"
would make the base backup avoid copying all WAL files, copying them
in parallel with a secondary process which uses the same facility as
pg_receiverwal, in which case the set of files in
pg_wal/archive_status/ has little meaning.

I am also curious about the way you use to do failovers.  Let me
guess: you stop the standby, delete its recovery.conf and then restart
the former standby?  This would prevent a timeline jump at promotion
which would explain the conflicts you are seeing when archiving two
times the same segment.
--
Michael

Attachments:

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

view thread (4+ messages)  latest in thread

Message-ID: <20190218012742.GH1864@paquier.xyz>
Permalink:  ../20190218012742.GH1864@paquier.xyz/
Also on:    postgresql.org/message-id/20190218012742.GH1864@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, apiwoni@webmd.net
  Subject: Re: Promoted slave tries to archive previously archived WAL file
  In-Reply-To: <20190218012742.GH1864@paquier.xyz>
  References: <CAEC-+VGYLE+mwwVtyiUD7D6-w4KoKxA+g_q4KE=B54gFw6Fy_g@mail.gmail.com> <CAEC-+VHAQVCCCiT0pEcg=CZvmXUFeFDGaxGJgFtv5+G7NOqjAA@mail.gmail.com> <20190218012742.GH1864@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