pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stephen Frost <sfrost@snowman.net>
To: David Steele <david@pgmasters.net>
Cc: Andres Freund <andres@anarazel.de>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Cc: Michael Paquier <michael.paquier@gmail.com>
Subject: Re: PATCH: Exclude unlogged tables from base backups
Date: Wed, 13 Dec 2017 10:04:57 -0500
Message-ID: <20171213150456.GI4628@tamriel.snowman.net> (raw)
In-Reply-To: <d3f60151-03b3-9443-e07c-aaaf42e9dd55@pgmasters.net>
References: <04791bab-cb04-ba43-e9c0-664a4c1ffb2c@pgmasters.net>
	<20171212225234.jqdwd4sp663l4znp@alap3.anarazel.de>
	<5e428ad7-f37f-6479-aabf-2c8b9318fb79@pgmasters.net>
	<20171212230740.evr7rvkzz5bztdg6@alap3.anarazel.de>
	<20171213014804.GH4628@tamriel.snowman.net>
	<d3f60151-03b3-9443-e07c-aaaf42e9dd55@pgmasters.net>

David,

* David Steele (david@pgmasters.net) wrote:
> On 12/12/17 8:48 PM, Stephen Frost wrote:
> > I don't think there is, because, as David points out, the unlogged
> > tables are cleaned up first and then WAL replay happens during recovery,
> > so the init fork will cause the relation to be overwritten, but then
> > later the logged 'drop table' and subsequent re-use of the relfilenode
> > to create a new table (or persistence change) will all be in the WAL and
> > will be replayed over top and will take care of this.
> 
> Files can be copied in any order, so if an OID is recycled the backup
> could copy its first, second, or nth incarnation.  It doesn't really
> matter since all of it will be clobbered by WAL replay.
> 
> The new base backup code just does the non-init fork removal in advance,
> following the same rules that would apply on recovery given the same
> file set.

Just to be clear- the new base backup code doesn't actually *do* the
non-init fork removal, it simply doesn't include the non-init fork in
the backup when there is an init fork, right?

We certainly wouldn't want a basebackup actually running around removing
the main fork for unlogged tables on a running and otherwise healthy
system. ;)

Thanks!

Stephen

Attachments:

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

view thread (39+ messages)  latest in thread

Message-ID: <20171213150456.GI4628@tamriel.snowman.net>
Permalink:  ../20171213150456.GI4628@tamriel.snowman.net/
Also on:    postgresql.org/message-id/20171213150456.GI4628@tamriel.snowman.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 using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: sfrost@snowman.net, david@pgmasters.net, andres@anarazel.de, michael.paquier@gmail.com
  Subject: Re: PATCH: Exclude unlogged tables from base backups
  In-Reply-To: <20171213150456.GI4628@tamriel.snowman.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