pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@anarazel.de>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Change snapshot type to be determined by enum rather than callba
Date: Tue, 22 Jan 2019 01:15:36 +0000
Message-ID: <E1glkfA-0006nq-PP@gemulon.postgresql.org> (raw)

Change snapshot type to be determined by enum rather than callback.

This is in preparation for allowing the same snapshot be used for
different table AMs. With the current callback based approach we would
need one callback for each supported AM, which clearly would not be
extensible.  Thus add a new Snapshot->snapshot_type field, and move
the dispatch into HeapTupleSatisfiesVisibility() (which is now a
function). Later work will then dispatch calls to
HeapTupleSatisfiesVisibility() and other AMs visibility functions
depending on the type of the table.  The central SnapshotType enum
also seems like a good location to centralize documentation about the
intended behaviour of various types of snapshots.

As tqual.h isn't included by bufmgr.h any more (as HeapTupleSatisfies*
isn't referenced by TestForOldSnapshot() anymore) a few files now need
to include it directly.

Author: Andres Freund, loosely based on earlier work by Haribabu Kommi
Discussion:
    https://postgr.es/m/20180703070645.wchpu5muyto5n647@alap3.anarazel.de
    https://postgr.es/m/20160812231527.GA690404@alvherre.pgsql

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/63746189b23815415cacc715fdc4f6b991f1a5e7

Modified Files
--------------
contrib/amcheck/verify_nbtree.c             |  1 +
contrib/pg_visibility/pg_visibility.c       |  2 +
src/backend/access/nbtree/nbtsort.c         |  1 +
src/backend/replication/logical/snapbuild.c |  6 +-
src/backend/utils/time/snapmgr.c            | 10 ++--
src/backend/utils/time/tqual.c              | 86 ++++++++++++++++++---------
src/include/storage/bufmgr.h                |  5 +-
src/include/utils/snapshot.h                | 90 +++++++++++++++++++++++++----
src/include/utils/tqual.h                   | 40 +++----------
src/tools/pgindent/typedefs.list            |  2 +-
10 files changed, 161 insertions(+), 82 deletions(-)



Message-ID: <E1glkfA-0006nq-PP@gemulon.postgresql.org>
Permalink:  ../E1glkfA-0006nq-PP@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1glkfA-0006nq-PP@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: andres@anarazel.de
  Subject: Re: pgsql: Change snapshot type to be determined by enum rather than callba
  In-Reply-To: <E1glkfA-0006nq-PP@gemulon.postgresql.org>
  References: <E1glkfA-0006nq-PP@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