pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
To: Masahiko Sawada <sawada.mshk@gmail.com>
Cc: Zhijie Hou <houzhijie22@gmail.com>
Cc: Amit Kapila <amit.kapila16@gmail.com>
Cc: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Cc: Chao Li <li.evan.chao@gmail.com>
Cc: Fujii Masao <masao.fujii@gmail.com>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: Add a hook for handling logical decoding messages on subscribers.
Date: Wed, 18 Nov 2026 06:43:47 +0000
Message-ID: <av1JIyFMSMRXzzt0@bdtpg> (raw)
In-Reply-To: <CAD21AoDYLM7BQsDs7Mw91MeZusDZVekuuBK7eSgVJo3=a8DCuA@mail.gmail.com>
References: <CAD21AoAhdXE1+i_bfGx3H=MheEizysk8uRirkZ3Y-v=AJzVvYw@mail.gmail.com>
	<CAD21AoC-pOvm54YzNiihFS90kSDRWr=qG6BE-9HW-YW=tqRubw@mail.gmail.com>
	<CAD21AoAWtvvHi1F2kSU2wOvNxfSDzQWNXYW4yL4B4Ttoq-Ek7A@mail.gmail.com>
	<CAA4eK1K3ypFDLk1R1DEx7YqCRbjNLTtJPP5+FfcX0F63rQ+Ekg@mail.gmail.com>
	<avWPil2vQXgXQBn+@bdtpg>
	<CAD21AoDQdj2xouprHesGvSFGVwZYJJp=qZfgUL6m_HLdEMvaoQ@mail.gmail.com>
	<4d9e1d2f-27a2-40ec-92c8-4b5740736cf8@gmail.com>
	<CAD21AoCbrcp=E5M4uMxfHLXsJsKfDscBoy-Bfhvqt6YuMhOEgw@mail.gmail.com>
	<avwM5nLKh0lApeKU@bdtpg>
	<CAD21AoDYLM7BQsDs7Mw91MeZusDZVekuuBK7eSgVJo3=a8DCuA@mail.gmail.com>

Hi,

On Tue, Nov 17, 2026 at 02:14:15PM -0800, Masahiko Sawada wrote:
> On Tue, Nov 17, 2026 at 12:14 AM Bertrand Drouvot
> <bertranddrouvot.pg@gmail.com> wrote:
> >
> > Hi,
> >
> > On Mon, Nov 16, 2026 at 11:05:00AM -0800, Masahiko Sawada wrote:
> > >
> > > I've attached the updated patches.
> >
> > Thanks!
> >
> > I did not look in details but I have a question. I'm wondering what would happen
> > with an unpatched publisher when both messages and streaming are enabled. Suppose
> > a message is emitted in a subtransaction that is later aborted. The publisher
> > sends the top level XID with the message, whereas STREAM ABORT refers to the
> > subtransaction XID. IIUC, the patched subscriber would therefore not discard that
> > message.
> >
> > Should 0002 handle this case somehow?
> 
> Good point. In that case, the subscriber would apply the message when
> the top-level transaction commits, even though the subtransaction that
> emitted it was rolled back.

Yeah, thanks for confirming.

> Given that the 0001 patch is not backpatched, I think the subscriber
> should request the messages option only from v20 or later publishers,
> like it doesn't send the origin option to publishers older than v16.
> The patch already checks the publisher version there, so we just need
> to raise it from v14 to v20. What do you think?

One difference with origin is that older publishers do not support that option
at all, whereas v14 through v19 publishers support messages and the issue occurs
only when streaming is enabled.

I wonder if it would make sense to request messages from those publishers when
streaming is disabled, and require v20 or later when streaming is enabled?

Regards,

-- 
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com






view thread (44+ messages)

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

 · 

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: bertranddrouvot.pg@gmail.com, sawada.mshk@gmail.com, houzhijie22@gmail.com, amit.kapila16@gmail.com, bharath.rupireddyforpostgres@gmail.com, li.evan.chao@gmail.com, masao.fujii@gmail.com
  Subject: Re: Add a hook for handling logical decoding messages on subscribers.
  In-Reply-To: <av1JIyFMSMRXzzt0@bdtpg>
  References: <CAD21AoAhdXE1+i_bfGx3H=MheEizysk8uRirkZ3Y-v=AJzVvYw@mail.gmail.com> <CAD21AoC-pOvm54YzNiihFS90kSDRWr=qG6BE-9HW-YW=tqRubw@mail.gmail.com> <CAD21AoAWtvvHi1F2kSU2wOvNxfSDzQWNXYW4yL4B4Ttoq-Ek7A@mail.gmail.com> <CAA4eK1K3ypFDLk1R1DEx7YqCRbjNLTtJPP5+FfcX0F63rQ+Ekg@mail.gmail.com> <avWPil2vQXgXQBn+@bdtpg> <CAD21AoDQdj2xouprHesGvSFGVwZYJJp=qZfgUL6m_HLdEMvaoQ@mail.gmail.com> <4d9e1d2f-27a2-40ec-92c8-4b5740736cf8@gmail.com> <CAD21AoCbrcp=E5M4uMxfHLXsJsKfDscBoy-Bfhvqt6YuMhOEgw@mail.gmail.com> <avwM5nLKh0lApeKU@bdtpg> <CAD21AoDYLM7BQsDs7Mw91MeZusDZVekuuBK7eSgVJo3=a8DCuA@mail.gmail.com> <av1JIyFMSMRXzzt0@bdtpg>

* 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