Re: PATCH: Exclude unlogged tables from base backups - Mailing list pgsql-hackers

From Stephen Frost
Subject Re: PATCH: Exclude unlogged tables from base backups
Date
Msg-id 20171213150456.GI4628@tamriel.snowman.net
Whole thread Raw
In response to Re: PATCH: Exclude unlogged tables from base backups  (David Steele <david@pgmasters.net>)
Responses Re: PATCH: Exclude unlogged tables from base backups
List pgsql-hackers
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

Attachment

pgsql-hackers by date:

Previous
From: Dmitry Dolgov
Date:
Subject: Re: [HACKERS] eval_const_expresisions and ScalarArrayOpExpr
Next
From: Mark Dilger
Date:
Subject: Re: [HACKERS] Something for the TODO list: deprecating abstime and friends