pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Markus Wanner <markus.wanner@enterprisedb.com>
To: Amit Kapila <amit.kapila16@gmail.com>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Cc: Ajin Cherian <itsajin@gmail.com>
Subject: Re: [PATCH] Provide more information to filter_prepare
Date: Thu, 11 Mar 2021 10:14:48 +0100
Message-ID: <fd63284b-14fa-051a-fa51-e6999e8f4502@enterprisedb.com> (raw)
In-Reply-To: <CAA4eK1JZkvN3G+aeQJuk1RdUczRZ3vUoF0mMFNS+S8g2gF8fQA@mail.gmail.com>
References: <ee280000-7355-c4dc-e47b-2436e7be959c@enterprisedb.com>
	<CAA4eK1L1OWb4ia5PjmC5BpuktBZgfqZbz=9sWLv77dBpZfhu+A@mail.gmail.com>
	<f43bc7b3-798c-a259-17e2-51ab1e8eccc9@enterprisedb.com>
	<CAA4eK1JZkvN3G+aeQJuk1RdUczRZ3vUoF0mMFNS+S8g2gF8fQA@mail.gmail.com>

On 11.03.21 04:58, Amit Kapila wrote:
> But this happens when we are decoding prepare, so it is clear that the
> transaction is prepared, why any additional check?

An output plugin cannot assume the transaction is still prepared and 
uncommitted at the point in time it gets to decode the prepare. 
Therefore, the transaction may or may not be still in progress. 
However, my point is that the xid is the more generally useful 
identifier than the gid.

> What in this can't be done with GID and how XID can achieve it?

It's a convenience.  Of course, an output plugin could lookup the xid 
via the gid.  But why force it to have to do that when the xid would be 
so readily available?  (Especially given that seems rather expensive. 
Or how would an extension lookup the xid by gid?)

The initial versions by Nikhil clearly did include it (actually a full 
ReorderBufferTXN, which I think would be even better).  I'm not clear on 
your motivations to restrict the API.  What's clear to me is that the 
more information Postgres exposes to plugins and extensions, the easier 
it becomes to extend Postgres.  (Modulo perhaps API stability 
considerations.  A TransactionId clearly is not a concern in that area. 
  Especially given we expose the entire ReorderBufferTXN struct for 
other callbacks.)

Regards

Markus





view thread (26+ messages)  latest in thread

Message-ID: <fd63284b-14fa-051a-fa51-e6999e8f4502@enterprisedb.com>
Permalink:  ../fd63284b-14fa-051a-fa51-e6999e8f4502@enterprisedb.com/
Also on:    postgresql.org/message-id/fd63284b-14fa-051a-fa51-e6999e8f4502@enterprisedb.com

 · 

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-hackers@postgresql.org
  Cc: markus.wanner@enterprisedb.com, amit.kapila16@gmail.com, itsajin@gmail.com
  Subject: Re: [PATCH] Provide more information to filter_prepare
  In-Reply-To: <fd63284b-14fa-051a-fa51-e6999e8f4502@enterprisedb.com>
  References: <ee280000-7355-c4dc-e47b-2436e7be959c@enterprisedb.com> <CAA4eK1L1OWb4ia5PjmC5BpuktBZgfqZbz=9sWLv77dBpZfhu+A@mail.gmail.com> <f43bc7b3-798c-a259-17e2-51ab1e8eccc9@enterprisedb.com> <CAA4eK1JZkvN3G+aeQJuk1RdUczRZ3vUoF0mMFNS+S8g2gF8fQA@mail.gmail.com> <fd63284b-14fa-051a-fa51-e6999e8f4502@enterprisedb.com>

* 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