RE: RE: Re:BUG #18369: logical decoding core on AssertTXNLsnOrder()

From: "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>
To: 'Amit Kapila' <amit(dot)kapila16(at)gmail(dot)com>, ocean_li_996 <ocean_li_996(at)163(dot)com>
Cc: Alexander Lakhin <exclusion(at)gmail(dot)com>, "pgsql-bugs(at)lists(dot)postgresql(dot)org" <pgsql-bugs(at)lists(dot)postgresql(dot)org>, "feichanghong(at)qq(dot)com" <feichanghong(at)qq(dot)com>
Subject: RE: RE: Re:BUG #18369: logical decoding core on AssertTXNLsnOrder()
Date: 2024-03-09 04:50:02
Message-ID: TYCPR01MB1207790E98F0A563280CC39FCF5262@TYCPR01MB12077.jpnprd01.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Dear Amit,

OK, so let's consider the approach. Note that at this stage, another failure [1]
was ignored.

Here are patches for all supported versions. The failure on PG12-PG15 has been
fixed on my env, but you can confirm as well.

The approach is almost same as what initially shared by Haiyang [2]. However,
instead of extending ReorderBufferXidSetCatalogChanges(), a new function
ReorderBufferXidSetCatalogChangesEx() was added.

Note again that there were changes also in ReorderBufferAssignChild() and
ReorderBufferCleanupTXN(). Extended ReorderBufferXidSetCatalogChanges would the
create ReorderBufferTXN not as top, however, these transaction would not be
associated with the top one. So there is a possibility that txn->node is invalid.
IIUC, only ReorderBufferAssignChild() calls ReorderBufferTXNByXid with create = true
and create_as_top = false, and they would be immediately associated in below.

```
/* add to subtransaction list */
dlist_push_tail(&txn->subtxns, &subtxn->node);
txn->nsubtxns++;
```

[1]: https://www.postgresql.org/message-id/TYCPR01MB12077573479C5A2471BDE8065F5232%40TYCPR01MB12077.jpnprd01.prod.outlook.com
[2]: https://www.postgresql.org/message-id/6d0e80d6.c1fc.18deeb8120a.Coremail.ocean_li_996%40163.com

Best Regards,
Hayato Kuroda
FUJITSU LIMITED
https://www.fujitsu.com/

Attachment Content-Type Size
REL_15_fix_coredump.patch application/octet-stream 7.5 KB
REL_12_fix_coredump.patch application/octet-stream 7.4 KB
REL_13_fix_coredump.patch application/octet-stream 7.4 KB
REL_14_fix_coredump.patch application/octet-stream 7.5 KB

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2024-03-10 19:00:00 BUG #18385: Assert("strategy_delta >= 0") in BgBufferSync() fails due to race condition
Previous Message Tom Lane 2024-03-08 15:28:26 Re: BUG #18384: It's not bug just question about documentation