pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: Andre Piwoni <apiwoni@webmd.net>
Cc: Maksim Milyutin <milyutinma@gmail.com>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #15638: pg_basebackup with --wal-method=stream incorrectly generates WAL segment created during backup
Date: Thu, 21 Feb 2019 13:56:03 +0900
Message-ID: <20190221045603.GM15532@paquier.xyz> (raw)
In-Reply-To: <CAEC-+VH5PrQyrVHZU-t55xfzUwhZ=XSFGtt6M13Aai8rqNMkcQ@mail.gmail.com>
References: <15638-426547bdd97938dd@postgresql.org>
	<20190216152503.GK2240@paquier.xyz>
	<b8217ce6-c620-0997-7ccf-b6f809a08645@gmail.com>
	<CAEC-+VHa5zh6_p6xEyj2p2WjpdEkFw0pUK4V9AyY4JKL8MvoGw@mail.gmail.com>
	<20190220035011.GE15532@paquier.xyz>
	<CAEC-+VH5PrQyrVHZU-t55xfzUwhZ=XSFGtt6M13Aai8rqNMkcQ@mail.gmail.com>

On Wed, Feb 20, 2019 at 09:58:12AM -0800, Andre Piwoni wrote:
> Also, what do you mean that my archive command is not safe? It is straight
> from PostrgreSQL docs and other resources:
> https://www.postgresql.org/docs/10/continuous-archiving.html
> https://www.opsdash.com/blog/postgresql-wal-archiving-backup.html

The docs are not the best thing on this side...  One immediate problem
one could note is that cp does not flush the segment.  So if your host
crashes before the OS flushes the copied data then the WAL segment
data is lost.  The flush needs to happen before the archive command
returns its status to the server.

> It seems you agree that segment created during pg_basebackup with stream
> mode, which is not marked with .done extension, would be attempted to be
> archived again. I also understand stream method during backup is default so
> changing this behavior may have an impact. If there's any free solution you
> could recommend for backup strategy please let me know.

pgBackRest and repmgr are tools mentioned on the lists.
--
Michael

Attachments:

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

view thread (12+ messages)  latest in thread

Message-ID: <20190221045603.GM15532@paquier.xyz>
Permalink:  ../20190221045603.GM15532@paquier.xyz/
Also on:    postgresql.org/message-id/20190221045603.GM15532@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-bugs@postgresql.org
  Cc: michael@paquier.xyz, apiwoni@webmd.net, milyutinma@gmail.com
  Subject: Re: BUG #15638: pg_basebackup with --wal-method=stream incorrectly generates WAL segment created during backup
  In-Reply-To: <20190221045603.GM15532@paquier.xyz>
  References: <15638-426547bdd97938dd@postgresql.org> <20190216152503.GK2240@paquier.xyz> <b8217ce6-c620-0997-7ccf-b6f809a08645@gmail.com> <CAEC-+VHa5zh6_p6xEyj2p2WjpdEkFw0pUK4V9AyY4JKL8MvoGw@mail.gmail.com> <20190220035011.GE15532@paquier.xyz> <CAEC-+VH5PrQyrVHZU-t55xfzUwhZ=XSFGtt6M13Aai8rqNMkcQ@mail.gmail.com> <20190221045603.GM15532@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