Re: BUG #15638: pg_basebackup with --wal-method=stream incorrectly generates WAL segment created during backup

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Andre Piwoni <apiwoni(at)webmd(dot)net>
Cc: Maksim Milyutin <milyutinma(at)gmail(dot)com>, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #15638: pg_basebackup with --wal-method=stream incorrectly generates WAL segment created during backup
Date: 2019-02-21 04:56:03
Message-ID: 20190221045603.GM15532@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Hans Buschmann 2019-02-21 09:21:55 AW: BUG #15641: Autoprewarm worker fails to start on Windows with huge pages in use Old PostgreSQL community/pgsql-bugs x
Previous Message David Rowley 2019-02-21 01:29:33 Re: BUG #15572: Misleading message reported by "Drop function operation" on DB with functions having same name