Re: Bug in logical decoding with DDL and subtransactions

From: Dilip Kumar <dilipbalaut(at)gmail(dot)com>
To: Rajesh Kumar Thandapani <rajeshkumarth(at)google(dot)com>
Cc: "alvherre(at)kurilemu(dot)de" <alvherre(at)kurilemu(dot)de>, Manu <manuelreyesbravo(at)gmail(dot)com>, Ayush Tiwari <ayushtiwari(dot)slg01(at)gmail(dot)com>, Bingshuai Li <lucian1412(at)outlook(dot)com>, Zhijie Hou <houzhijie22(at)gmail(dot)com>, "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Alexander Lakhin <exclusion(at)gmail(dot)com>, Mark Dilger <mark(dot)dilger(at)enterprisedb(dot)com>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, Andrey Rachitskiy <pl0h0yp1(at)gmail(dot)com>, "a(dot)kozhemyakin(at)postgrespro(dot)ru" <a(dot)kozhemyakin(at)postgrespro(dot)ru>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Bug in logical decoding with DDL and subtransactions
Date: 2026-11-24 05:17:03
Message-ID: CAFiTN-u1Ma8qtTXXA15OHP3dHg+3ZXuyUUQGkODBa9P9k0oLmQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Nov 23, 2026 at 6:10 PM Rajesh Kumar Thandapani
<rajeshkumarth(at)google(dot)com> wrote:
>
> On Mon, Nov 23, 2026 at 11:43 AM Alvaro Herrera <alvherre(at)kurilemu(dot)de> wrote:
> > Hmm, so I'm inclined to do this in master only, as I don't think
> > tuplecid lists are very large generally.
>
> Targeting master only makes sense to me.
>
> Re-attaching the v1 patch here on this thread (my earlier message
> accidentally dropped In-Reply-To and started a separate thread). On top
> of Ayush's snippet and Manu's feedback, it also returns early when
> toptxn->tuplecids is empty, adds an Assert in
> ReorderBufferAddNewTupleCids() that subxid has RBTXN_HAS_CATALOG_CHANGES
> set, and adds the tuplecid_nested.spec permutation with a regular write
> in the outer savepoint.

Yeah logically it makes sense to skip scanning the tuplecid list for
every aborted subtransaction, when it has not made any catalog
changes. I will review it one more time, but at high level it looks
good. And I think we should do this on master only.

--
Regards,
Dilip Kumar
Google

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Kirill Reshke 2026-11-24 05:22:10 Re: SLOPE - Planner optimizations on monotonic expressions.
Previous Message Peter Smith 2026-11-24 04:45:57 Re: Proposal: Conflict log history table for Logical Replication