pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Robert Haas <rhaas@postgresql.org>
To: pgsql-committers@postgresql.org
Subject: pgsql: Log the creation of an init fork unconditionally.
Date: Thu, 08 Dec 2016 19:35:33 +0000
Message-ID: <E1cF4Td-0000UH-CF@gemulon.postgresql.org> (raw)
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>

Log the creation of an init fork unconditionally.

Previously, it was thought that this only needed to be done for the
benefit of possible standbys, so wal_level = minimal skipped it.
But that's not safe, because during crash recovery we might replay
XLOG_DBASE_CREATE or XLOG_TBLSPC_CREATE record which recursively
removes the directory that contains the new init fork.  So log it
always.

The user-visible effect of this bug is that if you create a database
or tablespace, then create an unlogged table, then crash without
checkpointing, then restart, accessing the table will fail, because
the it won't have been properly reset.  This commit fixes that.

Michael Paquier, per a report from Konstantin Knizhnik.  Wording of
the comments per a suggestion from me.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/fa0f466d5329e10b16f3b38c8eaf5306f7e234e8

Modified Files
--------------
contrib/bloom/blinsert.c              | 13 +++++++++----
src/backend/access/nbtree/nbtree.c    | 13 +++++++++----
src/backend/access/spgist/spginsert.c | 23 +++++++++++++----------
src/backend/catalog/heap.c            | 13 +++++++------
4 files changed, 38 insertions(+), 24 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


view thread (6+ messages)  latest in thread

Message-ID: <E1cF4Td-0000UH-CF@gemulon.postgresql.org>
Permalink:  ../E1cF4Td-0000UH-CF@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1cF4Td-0000UH-CF@gemulon.postgresql.org

 · 

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-committers@postgresql.org
  Cc: rhaas@postgresql.org
  Subject: Re: pgsql: Log the creation of an init fork unconditionally.
  In-Reply-To: <E1cF4Td-0000UH-CF@gemulon.postgresql.org>
  References: <E1cF4Td-0000UH-CF@gemulon.postgresql.org>

* 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