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: apiwoni(at)webmd(dot)net, 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-16 15:25:03
Message-ID: 20190216152503.GK2240@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Sat, Feb 16, 2019 at 12:26:13AM +0000, PG Bug reporting form wrote:
> When new slave is created by taking base backup from the primary using
> pg_basebackup with --wal-method=stream option the WAL file generated during
> the backup is different (as compared with diff or cmp command) than that on
> the master and in WAL archive directory. Furthermore, this file does not
> exist in pg_wal/archive_status with .done extension on new slave, though it
> exists in pg_wal directory, resulting in failed attempt to archive this file
> when slave node is promoted as master node.
> 2019-02-15 14:15:58.872 PST [5369] DETAIL: The failed archive command was:
> test ! -f /mnt/pgsql/archive/000000010000000000000002 && cp
> pg_wal/000000010000000000000002
> /mnt/pgsql/archive/000000010000000000000002

How do you promote your standby? In Postgres 10, the last, partial
WAL segment of a past timeline generated at promotion is renamed
.partial to avoid any conflicts, so as this should normally not
happen if you do not use archive_mode = always.

Please note that your archive command is not safe. For one, it does
not sync the archived segment before archive_command returns to the
backend..
--
Michael

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Maeldron T. 2019-02-16 19:13:32 Re: BUG #15638: pg_basebackup with --wal-method=stream incorrectly generates WAL segment created during backup
Previous Message Tom Lane 2019-02-16 04:32:04 Re: BUG #15631: Generated as identity field in a temporary table with on commit drop corrupts system catalogs