pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: David Steele <david@pgmasters.net>
To: Don Seiler <don@seiler.us>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: pgBackRest backup from standby
Date: Mon, 19 Feb 2018 09:53:26 -0500
Message-ID: <3f5aa386-32df-4ea9-51a6-ae0c918fd04f@pgmasters.net> (raw)
In-Reply-To: <CAHJZqBA+yuW3eXqn9OR5brNf1EE8NRbsrYJJpnejEe-BhXrbHg@mail.gmail.com>
References: <CAHJZqBAwmA4g84LV0Kiq58kFCpu835cPraah5i+uTP+4B3H8RQ@mail.gmail.com>
	<e0746162-fa29-19af-c735-1ac23007f87b@pgmasters.net>
	<CAHJZqBA+yuW3eXqn9OR5brNf1EE8NRbsrYJJpnejEe-BhXrbHg@mail.gmail.com>

Hi Don,

On 2/19/18 9:25 AM, Don Seiler wrote:
> On Mon, Feb 19, 2018 at 8:18 AM, David Steele <david@pgmasters.net
> <mailto:david@pgmasters.net>> wrote:
> 
>     It copies files that are not replicated from the primary so that a
>     primary-style backup is created. Anything that is replicated (which is
>     by far the bulk of the data) is copied from the standby.
> 
> OK so all data files would be copied from standby. Can you give me an
> example of the types of files that need to be copied from primary?
>  

Anything *not* in global (except pg_control), base, pg_tblspc,
pg_xact/pg_clog, and pg_multixact are copied from the primary.

For example, pg_stat is copied from the primary so these stats are
preserved on a standby backup.

pgBackRest uses all the same exclusions as pg_basebackup, so many
dirs/files are not copied at all: pg_dynshmem, pg_notify, pg_replslot,
pg_serial, pg_snapshots, pg_stat_tmp, pg_subtrans, etc.

Full list here
https://www.postgresql.org/docs/10/static/protocol-replication.html.

>     it's best to archive from the primary so a replication
>     failure does not affect your archiving.
> 
> Understood, just not something I can change in production primary at the
> moment. Hence looking to see about a quick one-off backup from standby.

For a quick one-off, pg_basebackup is your friend.

Regards,
-- 
-David
david@pgmasters.net




view thread (21+ messages)  latest in thread

Message-ID: <3f5aa386-32df-4ea9-51a6-ae0c918fd04f@pgmasters.net>
Permalink:  ../3f5aa386-32df-4ea9-51a6-ae0c918fd04f@pgmasters.net/
Also on:    postgresql.org/message-id/3f5aa386-32df-4ea9-51a6-ae0c918fd04f@pgmasters.net

 · 

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-general@postgresql.org
  Cc: david@pgmasters.net, don@seiler.us
  Subject: Re: pgBackRest backup from standby
  In-Reply-To: <3f5aa386-32df-4ea9-51a6-ae0c918fd04f@pgmasters.net>
  References: <CAHJZqBAwmA4g84LV0Kiq58kFCpu835cPraah5i+uTP+4B3H8RQ@mail.gmail.com> <e0746162-fa29-19af-c735-1ac23007f87b@pgmasters.net> <CAHJZqBA+yuW3eXqn9OR5brNf1EE8NRbsrYJJpnejEe-BhXrbHg@mail.gmail.com> <3f5aa386-32df-4ea9-51a6-ae0c918fd04f@pgmasters.net>

* 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