| From: | "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com> |
|---|---|
| To: | 'Bingshuai Li' <lucian1412(at)outlook(dot)com>, "alvherre(at)kurilemu(dot)de" <alvherre(at)kurilemu(dot)de>, Zhijie Hou <houzhijie22(at)gmail(dot)com> |
| Cc: | 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>, "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>, "mark(dot)dilger(at)enterprisedb(dot)com" <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> |
| Subject: | RE: Bug in logical decoding with DDL and subtransactions |
| Date: | 2026-10-09 03:13:12 |
| Message-ID: | OS7PR01MB1831721F9806F6B588590EC27F5922@OS7PR01MB18317.jpnprd01.prod.outlook.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
Hi Bingshuai,
> Thanks Álvaro for putting together v6. In cfbot run 37698593816, the two
> UBSan jobs, "Linux - Meson (32-bit)" and "Linux - Autoconf", fail with
> the same error:
Embarrassingly, I had not found the cfbot entry. Good catch.
Let me confirm one point, why the test could pass for some platforms?
> The guard belongs in TransactionIdInSubxactArray():
>
> if (nsubxacts == 0)
> return false;
LGTM.
> 1. I think the check is needed on a pass that restarts after a child's
> first WAL record. Later records can create a ReorderBuffer entry without
> replaying the record that established its toplevel association. The
> existing catalog_change_snapshot test describes this for NEW_CID records.
> I reproduced it with a nested variant on current master plus v6 and the
> guard above: at the outer abort, the primary XID was unknown, while a
> child in the subxacts array had an entry but was not a known subxact.
> The toplevel commit was skipped in that pass. So an entry's presence
> does not establish its association; I'd keep rbtxn_is_known_subxact()
> and explain that reason in the comment.
Even though the sub-transactions are not assigned as a child, the code works well
without the rbtxn_is_known_subxact(), right? If so we may not have to keep the
check.
Also, while thinking on it, I started to think whether we have to clean up
Tuplecids even if the transactions will be skipped. In this case transactions are
Not replied thus the issue won't happen, right?
> 3. Agreed. 0002 already rewrote the helper's comment. The decode.c
> comment could just explain why cleanup precedes the ReorderBufferAbort()
> loop, leaving the association reasoning in the helper.
I think the code comment atop the cleanup can be simper like:
```
/*
* Remove tuplecid changes queued by the aborted subtransactions
* from the toplevel transaction's list.
*/
ReorderBufferCleanupAbortedSubTxnTupleCids(ctx->reorder, xid,
```
Best regards,
Hayato Kuroda
FUJITSU LIMITED
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Richard Guo | 2026-10-09 03:21:56 | Wrong results from an antijoin |
| Previous Message | Manu | 2026-10-09 03:09:02 | Re: Fix doc: explanation of how postgres works when OOM killer is invoked |