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: Prevent "snapshot too old" from trying to return pruned TOAST tu
Date: Wed, 03 Aug 2016 20:52:34 +0000
Message-ID: <E1bV39W-0008CE-VK@gemulon.postgresql.org> (raw)
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>

Prevent "snapshot too old" from trying to return pruned TOAST tuples.

Previously, we tested for MVCC snapshots to see whether they were too
old, but not TOAST snapshots, which can lead to complaints about missing
TOAST chunks if those chunks are subject to early pruning.  Ideally,
the threshold lsn and timestamp for a TOAST snapshot would be that of
the corresponding MVCC snapshot, but since we have no way of deciding
which MVCC snapshot was used to fetch the TOAST pointer, use the oldest
active or registered snapshot instead.

Reported by Andres Freund, who also sketched out what the fix should
look like.  Patch by me, reviewed by Amit Kapila.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/3e2f3c2e423b3ae906668c186bac79522b8e3e29

Modified Files
--------------
src/backend/access/heap/tuptoaster.c | 37 +++++++++++++++++++++++++++++++----
src/backend/utils/time/snapmgr.c     | 38 ++++++++++++++++++++++++++++++++++++
src/backend/utils/time/tqual.c       |  1 -
src/include/storage/bufmgr.h         |  3 ++-
src/include/utils/snapmgr.h          |  1 +
src/include/utils/tqual.h            | 32 ++++++++++++++++++++----------
6 files changed, 96 insertions(+), 16 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: <E1bV39W-0008CE-VK@gemulon.postgresql.org>
Permalink:  ../E1bV39W-0008CE-VK@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1bV39W-0008CE-VK@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: Prevent "snapshot too old" from trying to return pruned TOAST tu
  In-Reply-To: <E1bV39W-0008CE-VK@gemulon.postgresql.org>
  References: <E1bV39W-0008CE-VK@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