Re: Promoted slave tries to archive previously archived WAL file

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Andre Piwoni <apiwoni(at)webmd(dot)net>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Promoted slave tries to archive previously archived WAL file
Date: 2019-02-18 01:27:42
Message-ID: 20190218012742.GH1864@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Thomas Munro 2019-02-18 02:34:48 Re: WSL (windows subsystem on linux) users will need to turn fsync off as of 11.2
Previous Message Michael Paquier 2019-02-18 01:19:15 Re: WSL (windows subsystem on linux) users will need to turn fsync off as of 11.2