Re: pg_basebackup -x/X doesn't play well with archive_mode & wal_keep_segments - Mailing list pgsql-hackers

From Andres Freund
Subject Re: pg_basebackup -x/X doesn't play well with archive_mode & wal_keep_segments
Date
Msg-id 20141231153219.GE19836@alap3.anarazel.de
Whole thread Raw
In response to Re: pg_basebackup -x/X doesn't play well with archive_mode & wal_keep_segments  (Fujii Masao <masao.fujii@gmail.com>)
Responses Re: pg_basebackup -x/X doesn't play well with archive_mode & wal_keep_segments  (Andres Freund <andres@2ndquadrant.com>)
List pgsql-hackers
Hi,

On 2014-12-05 16:18:02 +0900, Fujii Masao wrote:
> On Fri, Dec 5, 2014 at 9:28 AM, Andres Freund <andres@2ndquadrant.com> wrote:
> > So I think we just need to make pg_basebackup create to .ready
> > files.
>
> s/.ready/.done? If yes, +1.

That unfortunately requires changes to both backend and pg_basebackup to
support fetch and stream modes respectively.

I've attached a preliminary patch for this. I'd appreciate feedback. I
plan to commit it in a couple of days, after some more
testing/rereading.

> > Given that the walreceiver and restore_command already
> > unconditionally do XLogArchiveForceDone() I think we'd follow the
> > established precedent. Arguably it could make sense to archive files
> > again on the standby after a promotion as they aren't guaranteed to have
> > been on the then primary. But we don't have any infrastructure anyway
> > for that and walsender doesn't do so, so it doesn't seem to make any
> > sense to do that for pg_basebackup.
> >
> > Independent from this bug, there's also some debatable behaviour about
> > what happens if a node with a high wal_keep_segments turns on
> > archive_mode. Suddenly all those old files are archived... I think it
> > might be a good idea to simply always create .done files when
> > archive_mode is disabled while a wal segment is finished.
>
> +1

I tend to think that's a master only change. Agreed?

Greetings,

Andres Freund

Attachment

pgsql-hackers by date:

Previous
From: Stephen Frost
Date:
Subject: Re: Additional role attributes && superuser review
Next
From: Robert Haas
Date:
Subject: Re: psql tab completion: fix COMMENT ON ... IS IS IS