| From: | Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com> |
|---|---|
| To: | Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com> |
| Cc: | Zhijie Hou <houzhijie22(at)gmail(dot)com>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>, Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>, Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org> |
| Subject: | Re: Add a hook for handling logical decoding messages on subscribers. |
| Date: | 2026-11-17 22:14:15 |
| Message-ID: | CAD21AoDYLM7BQsDs7Mw91MeZusDZVekuuBK7eSgVJo3=a8DCuA@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On Tue, Nov 17, 2026 at 12:14 AM Bertrand Drouvot
<bertranddrouvot(dot)pg(at)gmail(dot)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.
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?
Regards,
--
Masahiko Sawada
Amazon Web Services: https://aws.amazon.com
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Nathan Bossart | 2026-11-17 22:19:36 | Re: Logical Implication |
| Previous Message | Zsolt Parragi | 2026-11-17 22:08:26 | Re: [***DKIM violation***] Re: [PATCH] Fix heap-buffer-overflow in PGTYPEStimestamp_defmt_scan() |