pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Alexey Bashtanov <bashtanov@imap.cc>
Cc: pgsql-bugs@postgresql.org
Cc: mmitar@gmail.com
Subject: Re: Is temporary functions feature official/supported? Found some issues with it.
Date: Fri, 4 Jan 2019 12:43:37 -0300
Message-ID: <201901041543.wdduitrlu2th@alvherre.pgsql> (raw)
In-Reply-To: <20190104131351.GF2067@paquier.xyz>

On 2019-Jan-04, Michael Paquier wrote:

> That should not be allowed to commit directly.  I think that we should
> just add a new value for MyXactFlags which tracks the transaction
> where the temporary namespace has been created, and generate an error
> if trying to use 2PC in this case.

That implies that a 2PC transaction will fail if it's run in a session
for which the temp namespace doesn't previously exist.  I think it's a
fairly ugly failure mode, and one that normal testing will not catch
because it'll occur very rarely.  An app that detects this problem at
run time will have to create a random temp object, commit normally, then
re-run the 2PC transaction from the start ... a lot of code to deal with
something that shouldn't happen in the first place.

I wonder if we can somehow create the temp schema in a way that makes it
immediately visible to everyone, and not depend on the commit status of
the creating transaction -- say mark the tuple with xmin=frozenXid or
something like ugly that.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services




view thread (22+ messages)  latest in thread

Message-ID: <201901041543.wdduitrlu2th@alvherre.pgsql>
Permalink:  ../201901041543.wdduitrlu2th@alvherre.pgsql/
Also on:    postgresql.org/message-id/201901041543.wdduitrlu2th@alvherre.pgsql

 · 

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-bugs@postgresql.org
  Cc: alvherre@2ndquadrant.com, michael@paquier.xyz, tgl@sss.pgh.pa.us, bashtanov@imap.cc, mmitar@gmail.com
  Subject: Re: Is temporary functions feature official/supported? Found some issues with it.
  In-Reply-To: <201901041543.wdduitrlu2th@alvherre.pgsql>
  References: <20190104131351.GF2067@paquier.xyz> <201901041543.wdduitrlu2th@alvherre.pgsql>

* 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