Re: Make stream_prepare an optional callback

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: Markus Wanner <markus(dot)wanner(at)enterprisedb(dot)com>
Cc: Ajin Cherian <itsajin(at)gmail(dot)com>, PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Make stream_prepare an optional callback
Date: 2021-03-09 08:39:43
Message-ID: CAA4eK1Ky+uLdaYbnsZGtCHS4r=PcMj99J_UjeUYciNZOi=GuOg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Mar 9, 2021 at 1:55 PM Markus Wanner
<markus(dot)wanner(at)enterprisedb(dot)com> wrote:
>
> On 09.03.21 07:40, Amit Kapila wrote:
> > Sounds reasonable to me. I also don't see a reason why we need to make
> > this a necessary callback. Some plugin authors might just want 2PC
> > without streaming support.
>
> Sounds okay to me. Probably means we'll have to check for this callback
> and always skip the prepare for streamed transactions,
>

I think so. The behavior has to be similar to other optional callbacks
like message_cb, truncate_cb, stream_truncate_cb. Basically, we don't
need to error out if those callbacks are not provided.

> w/o even
> triggering filter_prepare, right?
>

I think the filter check is before we try to send the actual message.

> (Because the extension requesting not
> to filter it, but not providing the corresponding callback does not make
> sense.)
>

The extension can request two_phase without streaming.

> If you're going to together a patch Ajin, I'm happy to review.
>

It is attached with the initial email.

--
With Regards,
Amit Kapila.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Markus Wanner 2021-03-09 08:44:40 [PATCH] Provide more information to filter_prepare
Previous Message Pavel Stehule 2021-03-09 08:29:45 Re: [PATCH] regexp_positions ( string text, pattern text, flags text ) → setof int4range[]