pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Antonin Houska <ah@cybertec.at>
To: Andres Freund <andres@anarazel.de>
Cc: pgsql-hackers@lists.postgresql.org, Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: pgsql-hackers@postgresql.org
Subject: Re: Incorrect visibility test function assigned to snapshot
Date: Wed, 30 May 2018 16:00:44 +0200
Message-ID: <28524.1527688844@localhost> (raw)
In-Reply-To: <B6BD7989-0298-4E05-B5AA-9B97843826BE@anarazel.de>
References: <20180530132854.tkv37qiamepu3slh@alvherre.pgsql>
	<28218.1527687932@localhost>
	<B6BD7989-0298-4E05-B5AA-9B97843826BE@anarazel.de>

Andres Freund <andres@anarazel.de> wrote:

> On May 30, 2018 9:45:32 AM EDT, Antonin Houska <ah@cybertec.at> wrote:
> >Alvaro Herrera <alvherre@2ndquadrant.com> wrote:
> >
> >> On 2018-May-30, Antonin Houska wrote:
> >> 
> >> > In the header comment, SnapBuildInitialSnapshot() claims to set
> >> > snapshot->satisfies to the HeapTupleSatisfiesMVCC test function,
> >and indeed it
> >> > converts the "xid" array to match its semantics (i.e. the xid items
> >eventually
> >> > represent running transactions as opposed to the committed ones).
> >However the
> >> > test function remains HeapTupleSatisfiesHistoricMVCC as set by
> >> > SnapBuildBuildSnapshot().
> >> 
> >> Interesting.  While this sounds like an oversight that should have
> >> horrible consequences, it's seems not to because the current callers
> >> don't seem to care about the ->satisfies function.  Are you able to
> >come
> >> up with some scenario in which it causes an actual problem?
> >
> >Right, the current callers in the core do not seem to use that
> >function. I hit
> >the issue when doing and testing some changes in an extension
> >(pg_squeeze).
> 
> What is that extension doing with that snapshot?

It fetches data from a table in order to insert them into a new table, to
eliminate bloat. Something like pg_repack, but it uses logical decoding
instead of triggers to capture concurrent data changes.

-- 
Antonin Houska
Cybertec Schönig & Schönig GmbH
Gröhrmühlgasse 26, A-2700 Wiener Neustadt
Web: https://www.cybertec-postgresql.com




view thread (12+ messages)  latest in thread

Message-ID: <28524.1527688844@localhost>
Permalink:  ../28524.1527688844@localhost/
Also on:    postgresql.org/message-id/28524.1527688844@localhost

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: ah@cybertec.at, andres@anarazel.de, alvherre@2ndquadrant.com
  Subject: Re: Incorrect visibility test function assigned to snapshot
  In-Reply-To: <28524.1527688844@localhost>

* 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