pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kevin Grittner <kgrittn@postgresql.org>
To: pgsql-committers@postgresql.org
Subject: pgsql: Add the "snapshot too old" feature
Date: Fri, 08 Apr 2016 19:45:45 +0000
Message-ID: <E1aocLh-0006C7-2W@gemulon.postgresql.org> (raw)
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>

Add the "snapshot too old" feature

This feature is controlled by a new old_snapshot_threshold GUC.  A
value of -1 disables the feature, and that is the default.  The
value of 0 is just intended for testing.  Above that it is the
number of minutes a snapshot can reach before pruning and vacuum
are allowed to remove dead tuples which the snapshot would
otherwise protect.  The xmin associated with a transaction ID does
still protect dead tuples.  A connection which is using an "old"
snapshot does not get an error unless it accesses a page modified
recently enough that it might not be able to produce accurate
results.

This is similar to the Oracle feature, and we use the same SQLSTATE
and error message for compatibility.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/848ef42bb8c7909c9d7baa38178d4a209906e7c1

Modified Files
--------------
contrib/bloom/blscan.c                             |   3 +-
doc/src/sgml/config.sgml                           |  50 +++
src/backend/access/brin/brin.c                     |  19 +-
src/backend/access/brin/brin_revmap.c              |  11 +-
src/backend/access/gin/ginbtree.c                  |   9 +-
src/backend/access/gin/gindatapage.c               |   7 +-
src/backend/access/gin/ginget.c                    |  22 +-
src/backend/access/gin/gininsert.c                 |   2 +-
src/backend/access/gist/gistget.c                  |   2 +-
src/backend/access/hash/hash.c                     |   3 +-
src/backend/access/hash/hashsearch.c               |  10 +-
src/backend/access/heap/heapam.c                   |  31 +-
src/backend/access/heap/pruneheap.c                |  11 +-
src/backend/access/nbtree/nbtinsert.c              |   7 +-
src/backend/access/nbtree/nbtpage.c                |   2 +-
src/backend/access/nbtree/nbtsearch.c              |  51 ++-
src/backend/access/spgist/spgscan.c                |   2 +-
src/backend/commands/vacuum.c                      |   3 +-
src/backend/commands/vacuumlazy.c                  |   3 +-
src/backend/storage/buffer/bufmgr.c                |  40 ++
src/backend/storage/ipc/ipci.c                     |   3 +
src/backend/storage/ipc/procarray.c                |   9 +
src/backend/storage/lmgr/lwlocknames.txt           |   1 +
src/backend/utils/errcodes.txt                     |   4 +
src/backend/utils/misc/guc.c                       |  11 +
src/backend/utils/misc/postgresql.conf.sample      |   2 +
src/backend/utils/time/snapmgr.c                   | 404 +++++++++++++++++++++
src/include/access/brin_revmap.h                   |   5 +-
src/include/access/gin_private.h                   |   4 +-
src/include/access/nbtree.h                        |   7 +-
src/include/storage/bufmgr.h                       |  19 +-
src/include/utils/rel.h                            |   1 +
src/include/utils/snapmgr.h                        |  13 +
src/include/utils/snapshot.h                       |   4 +
src/test/modules/Makefile                          |   1 +
src/test/modules/snapshot_too_old/Makefile         |  47 +++
.../snapshot_too_old/expected/sto_using_cursor.out |  73 ++++
.../snapshot_too_old/expected/sto_using_select.out |  55 +++
.../snapshot_too_old/specs/sto_using_cursor.spec   |  37 ++
.../snapshot_too_old/specs/sto_using_select.spec   |  36 ++
src/test/modules/snapshot_too_old/sto.conf         |   3 +
41 files changed, 942 insertions(+), 85 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 (18+ messages)  latest in thread

Message-ID: <E1aocLh-0006C7-2W@gemulon.postgresql.org>
Permalink:  ../E1aocLh-0006C7-2W@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1aocLh-0006C7-2W@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: kgrittn@postgresql.org
  Subject: Re: pgsql: Add the "snapshot too old" feature
  In-Reply-To: <E1aocLh-0006C7-2W@gemulon.postgresql.org>
  References: <E1aocLh-0006C7-2W@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